What is a container?

A container is an executable unit of software where an application and its run time dependencies can all be packaged together into one entity. Since everything needed by the application is packaged with the application itself, containers provide a degree of isolation from the host and make it easy to deploy and install the application without having to worry 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 does not require any 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 the top AI and data science software-- all tuned, tested and optimized by NVIDIA. Containers on NGC provide powerful and easy-to-deploy software proven to deliver fast results, allowing users to build solutions from a tested framework.

Visit 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 on the list of containers for Jetson hosted on NGC.

Using Containers

Downloading the Container

To download a container, one needs to use the “docker pull” command.

Usage:

docker pull [OPTIONS] NAME[:TAG|@DIGEST]

See docker pull documentation for details.

Follow the example below to download the L4T-base container from NGC:

sudo docker pull nvcr.io/nvidia/l4t-base:r32.4.3

Note that nvcr.io/nvidia/l4t-base is the name of the container and r32.4.3 is the tag. Tags provide a way to version control the containers.

Listing the Containers

You can view a list of containers already pulled to your developer kit using the “docker image ls” command.

Usage:

sudo docker image ls [OPTIONS] [REPOSITORY[:TAG]]

See docker image ls documentation for details.

Running Containers

Containers are run using docker run command.

Usage:

sudo docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...]

See docker run documentation for details.

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:r32.4.3

Visit the L4T-base container page for explanation on the above docker run command.

Congratulations on running your first container on Jetson!