Jetson Container Quick Start (Docker + NGC)
This guide demonstrates how to run a container on Jetson using Docker and NVIDIA NGC. It covers pulling an L4T image, listing images, and launching a container with the NVIDIA runtime to verify that your JetPack and container environment are working correctly.
Principle
What is a Container?
A container is an executable unit of software where an application and its runtime dependencies are all packaged into a single entity. Since everything the application needs is packaged with the application itself, containers provide a degree of isolation from the host, and applications can be easily deployed and installed without worrying about the host environment and application dependencies.
What is Docker?
Docker is an open-source platform for creating, deploying, and running containers. Docker is included in JetPack, so running containers on Jetson is easy and requires no additional installation.
What is NGC?
NVIDIA NGC is a hub for GPU-optimized deep learning, machine learning, and high-performance computing (HPC) software. NGC hosts containers for top-tier AI and data science software—all tuned, tested, and optimized by NVIDIA. Containers on NGC deliver powerful, easy-to-deploy software proven to deliver results quickly, enabling users to build solutions from tested frameworks.
Visit the NGC portal for more information at https://www.nvidia.com/en-us/gpu-cloud/.
Jetson Containers on NGC
Several containers for Jetson are hosted on NVIDIA NGC. Visit the Jetson Cloud Native page for a list of Jetson containers hosted on NGC.
Run Your First Container
Downloading a Container
To download a container, you need to use the "docker pull" command.
Usage:
docker pull [OPTIONS] NAME[:TAG|@DIGEST]
For more details, refer to the docker pull documentation.
Follow the example below to download the L4T-base container from NGC:
sudo docker pull nvcr.io/nvidia/l4t-base:r35.1.0
Note that nvcr.io/nvidia/l4t-base is the name of the container, and r35.1.0 is the tag. Tags provide a way to version containers.
Listing Containers
You can view the list of containers pulled into your developer kit using the "docker image ls" command.
Usage:
sudo docker image ls [OPTIONS] [REPOSITORY[:TAG]]
For more details, refer to the docker image ls documentation.
Running a Container
Containers are run using the docker run command.
Usage:
sudo docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...]
For more details, refer to the docker run documentation.
Follow the example below to run the L4T-base container:
sudo docker run -it --rm --net=host --runtime nvidia -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix nvcr.io/nvidia/l4t-base:r35.1.0
Visit the L4T-base Container Page for explanations of the above docker run command.
Congratulations on running your first container on Jetson!
Exit the Container
Use the following command to exit the current container:
exit
Was this article helpful?
