NVIDIA Container Runtime - #3 Build
1- Including project files into working directory
2- Creating a Dockerfile
3- Configuring the Dockerfile
OS: JetPack 4.3 (L4T-32.3.1)
In this blog post we will build new container image. With new container image we can run different kind of applications (for an example: Python, Deepstream, CUDA, etc.) in docker container. Also if it is needed, you can run console with additional packages in system.
To build a new image first create a folder and copy necessary files (like application source files or binaries) inside it.
Create image file with named "Dockerfile" inside folder.
Open "Dockerfile" with your favorite text editor then pass your base image next to "FROM" instruction. In this blog post we will build an image which starts "deepstream" application when it is run. Because of this we selected nvidia 's deepstream sample image.
In docker system each instruction inside "Dockerfile" compiled as layer, so order of instructions is important.
On next line you can use "RUN" instruction for necessary terminal commands to install new packages, create folders and symbolic links.
With "COPY" instruction copy your application source files inside container.
Select your work directory to build your application with "WORKDIR" instruction. Then again with "RUN" instruction build your application.
After building you should define your image startup functionality with "ENTRYPOINT" and "CMD" instructions. Difference between them is "ENTRYPOINT" is static, "CMD" is changeable. When you use "docker run" command to run container you can change "CMD" instruction.
Lastly, you can push your image to online registry for example "DockerHub". To do this first login then push your image to registry.
Thank you for reading our blog post.
If you want to get updated on new blog posts, product launches and discounts, you can fill out the form and sign up for our newsletter. By signing up, you can reach various blog posts about AI, deep learning, machine vision, high-speed cameras, and industrial interfaces.
You will receive a "free shipping" code for next purchase immediately.