Build Container Image

Learn how to build container image in Dev Pod.

Docker image is widely used as environment control. In this guide, we will show you how to build a container image in a Dev Pod.

Prerequisites

  • A Node Group with privilege mode enabled

Steps

Make sure privilege mode is enabled

Go to the node group page, and make sure the privilege mode is enabled for the node group you want to use. You can enable the privilege mode by clicking the "Config" button and select the "Privilege Mode" checkbox. Make sure it's enabled for the node group you want to use.

Create a Dev Pod

Create a dev pod with the node group you want to use. Make sure the dev pod is created with the privilege mode enabled in the Resource selection step. It is recommended to use the whole node for the dev pod with privilege mode enabled. Eg. select the shape with 8 gpus will use the whole node. For configurations, refer to this guide.

The default images allow the root access by default. If you want to use a custom image, you should make sure the image allows sudo access.

Install Docker and Required Plugins

Once the dev pod is created, you can connect to the dev pod via web terminal. Then copy the following script to the terminal and run it.

Once the script is executed, you can verify the GPU setup by running the following command.

You should see the GPU setup information like the following.

Build Your Container Image

Now you can build your container image in the dev pod. First, create a Dockerfile with your desired configuration. Here's a simple sample Dockerfile:

Now you can build your container image using the following command:

You can change the Dockerfile based on your needs to build your own container image. For more information about the Dockerfile, please refer to the Dockerfile reference.

Push to Remote Repository

Once the container image is built, you can push it to a remote repository for further use with docker image push command.

Copyright @ 2025, NVIDIA Corporation.