Docker image creation

Please provide the following info (tick the boxes after creating this topic):
Software Version
DRIVE OS 6.0.5
DRIVE OS 6.0.4 (rev. 1)
DRIVE OS 6.0.4 SDK
other

Target Operating System
Linux
QNX
other

Hardware Platform
DRIVE AGX Orin Developer Kit (940-63710-0010-D00)
DRIVE AGX Orin Developer Kit (940-63710-0010-C00)
DRIVE AGX Orin Developer Kit (not sure its number)
other

SDK Manager Version
1.9.0.10816
other

Host Machine Version
native Ubuntu Linux 20.04 Host installed with SDK Manager
native Ubuntu Linux 20.04 Host installed with DRIVE OS Docker Containers
native Ubuntu Linux 18.04 Host installed with DRIVE OS Docker Containers
other

Hello,

I want to add a cross compilation environment to my docker image.
are there steps to recreate the docker image with cross compilation environment?

Thanks,

Please refer to the below documents to use the docker image to cross-compile the samples.

Hi, Thanks for the answer.
That’s not really helpful.
I’d like to get the dockerfile and append it to my docker.
is that possible?

Thanks,

I’ll check internally and get back to you.

Please try the below steps.

  • Launch/Run DRIVE OS docker
  • Add additional bits/packages
  • Commit docker image, e.g. docker commit <docker containerid> <dockernameimageof your choice>

Once docker image is created , you can share that docker image internally

Hi @VickNV ,

Thanks for the answer.
The solution you provided is for extending the DriveOS docker container, however I would like to extend mine with DriveOS container, which as I understand, is possible if I have the commands the DriveOS container was created with.
So, please, can you provide the commands the DriveOS docker container was created with?

Thanks,

Our Dockerfile relies on some internal componenets for packaging software so it’s not usable for developers. After reviewing, we have determined that the following options are available for you.

  1. Build On Top of DRIVE OS Docker

You can follow standard Docker practices by treating NVIDIA DRIVE OS Docker as the base image. This can be done by using the FROM declaration at the top of their Dockerfile and specifying the desired NVIDA DRIVE OS Docker image from NGC.

This is the recommended option. However, this approach does not address your use case as you said.

  1. Utilize Docker Multi-stage Builds

You can follow standard Docker practices using the multi-stage build functionality provided by Docker (Multi-stage builds | Docker Documentation). With multi-stage builds, you do not need to build on top of NVIDIA DRIVE OS Docker and can instead utilize the COPY --from directive. The below example can be used as a template:

# syntax=docker/dockerfile:1
FROM

COPY --from= /opt/nvidia /opt
COPY --from= /drive ./
COPY --from=

However, this alone will not be sufficient. There are additional environment variables that will also need to be specified explicitly as they cannot be copied in the same way the files and directories will be copied. To account for this, DRIVE OS can perhaps provide a template file for you that does include some of these environment variables. We will of course have to make it a deliverable per image.

  1. Generate Dockerfile from DRIVE OS Docker Image

There are a number of open source tools that can be used to generate Dockerfiles from a Docker image. You are free to utilize the approach, however, NVIDIA does not provide support for any of those tools. If you chooses this option, you will still need to pull Docker image locally. Also, output of the generated Dockerfile will still not match the internal Dockerfiles used to generate the image in our own pipelines. Another point of consideration is that this generated Dockerfile will only be valid for the particular image:tag that it was generated from. If any new changes are available in a subsequent Docker, then you will need to regenerate a new Dockerfile based on that.

2 Likes

@NikolayChernuha
I found you have ticked my post as a solution. Could you also provide feedback and let us how you’re going to do with them? Thanks.

I just did a multistage build, however my docker image is now really big because the base image you provided is ~60GB, so that’s basically my starting point.

Considering the size of the base image, it’s not surprising that your resulting docker image is large. However, I understand that this may cause some issues for you. What specific problem are you experiencing at the moment? Please create another topic specific to the “Utilize Docker Multi-stage Builds” option. Thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.