├── .github └── ISSUE_TEMPLATE │ └── bug_report.md ├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── configure_qemu.sh ├── image ├── filesystem-error.png └── jetson-os-flash-setting.png └── launch_container.sh /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Bug report 11 | 12 | ### Required information: 13 | - Operating system of host machine => :grey_question: 14 | - Docker version => :grey_question: 15 | - NVIDIA SDK Manager version => :grey_question: 16 | - NVIDIA Jetson model(Jetson AGX Xavier, Jetson Nano etc...) => :grey_question: 17 | 18 | ### Description of the bug 19 | 20 | 21 | ### Steps to reproduce the bug 22 | 23 | 24 | ### Expected behavior 25 | 26 | 27 | 28 | ### Actual behavior 29 | 30 | 31 | 32 | ### Screenshots 33 | 34 | 35 | 36 | ### Additional information 37 | 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | jetpack_home 2 | sdkmanager_* 3 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | 3 | # ARGUMENTS 4 | ARG SDK_MANAGER_VERSION=1.8.0-10363 5 | ARG SDK_MANAGER_DEB=sdkmanager_${SDK_MANAGER_VERSION}_amd64.deb 6 | ARG GID=1000 7 | ARG UID=1000 8 | 9 | # add new sudo user 10 | ENV USERNAME jetpack 11 | ENV HOME /home/$USERNAME 12 | RUN useradd -m $USERNAME && \ 13 | echo "$USERNAME:$USERNAME" | chpasswd && \ 14 | usermod --shell /bin/bash $USERNAME && \ 15 | usermod -aG sudo $USERNAME && \ 16 | mkdir /etc/sudoers.d && \ 17 | echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/$USERNAME && \ 18 | chmod 0440 /etc/sudoers.d/$USERNAME && \ 19 | # Replace 1000 with your user/group id 20 | usermod --uid ${UID} $USERNAME && \ 21 | groupmod --gid ${GID} $USERNAME 22 | 23 | # install package 24 | RUN yes | unminimize && \ 25 | apt-get update && apt-get install -y --no-install-recommends \ 26 | build-essential \ 27 | curl \ 28 | git \ 29 | gpg \ 30 | gpg-agent \ 31 | gpgconf \ 32 | gpgv \ 33 | less \ 34 | libcanberra-gtk-module \ 35 | libcanberra-gtk3-module \ 36 | libgconf-2-4 \ 37 | libgtk-3-0 \ 38 | libnss3 \ 39 | libx11-xcb1 \ 40 | libxss1 \ 41 | libxtst6 \ 42 | net-tools \ 43 | python \ 44 | sshpass \ 45 | chromium-browser \ 46 | qemu-user-static \ 47 | binfmt-support \ 48 | libxshmfence1 \ 49 | && \ 50 | apt-get clean && \ 51 | rm -rf /var/lib/apt/lists/* 52 | 53 | # set locale 54 | RUN locale-gen en_US.UTF-8 55 | ENV LANG en_US.UTF-8 56 | ENV LANGUAGE en_US:en 57 | ENV LC_ALL en_US.UTF-8 58 | 59 | RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections 60 | 61 | # install SDK Manager 62 | USER jetpack 63 | COPY --chown=jetpack:jetpack ${SDK_MANAGER_DEB} /home/${USERNAME}/ 64 | WORKDIR /home/${USERNAME} 65 | RUN sudo apt-get install -f /home/${USERNAME}/${SDK_MANAGER_DEB} 66 | RUN rm /home/${USERNAME}/${SDK_MANAGER_DEB} 67 | 68 | # configure QEMU to fix https://forums.developer.nvidia.com/t/nvidia-sdk-manager-on-docker-container/76156/18 69 | # And, I refered to https://github.com/MiroPsota/sdkmanagerGUI_docker 70 | COPY --chown=jetpack:jetpack configure_qemu.sh /home/${USERNAME}/ 71 | ENTRYPOINT ["/bin/bash", "-c", "/home/jetpack/configure_qemu.sh"] 72 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 atinfinity 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # sdk_manager_docker 2 | 3 | ## Introduction 4 | 5 | This is a Dockerfile to use [NVIDIA SDK Manager](https://docs.nvidia.com/sdk-manager/) on Docker container. 6 | 7 | ## Important Information 8 | 9 | NVIDIA released official Docker image(). 10 | 11 | ## Requirements 12 | 13 | * Docker 14 | 15 | ## Preparation 16 | 17 | ### Download NVIDIA SDK Manager 18 | 19 | Please download the package of NVIDIA SDK Manager from . 20 | And, please put the package of NVIDIA SDK Manager in the same directory as the Dockerfile. 21 | This time, I used `sdkmanager_1.8.0-10363_amd64.deb`. 22 | 23 | ### Build Docker image 24 | 25 | ``` 26 | docker build --build-arg GID=$(id -g) --build-arg UID=$(id -u) -t jetpack . 27 | ``` 28 | 29 | To build a Docker image with a specific SDK Manager version override the ``SDK_MANAGER_VERSION`` variable in the Docker command line 30 | 31 | ``` 32 | docker build --build-arg SDK_MANAGER_VERSION=1.8.0-10363 --build-arg GID=$(id -g) --build-arg UID=$(id -u) -t jetpack . 33 | ``` 34 | 35 | ### Create Docker container 36 | 37 | ``` 38 | ./launch_container.sh 39 | ``` 40 | 41 | ## Launch NVIDIA SDK Manager 42 | 43 | Please launch NVIDIA SDK Manager by the following command. 44 | 45 | ``` 46 | sdkmanager 47 | ``` 48 | 49 | Please refer to . 50 | And, I tested in the following setting. 51 | 52 | * Manual Setup 53 | * OEM Configuration: Runtime 54 | 55 | ![](image/jetson-os-flash-setting.png) 56 | 57 | ## Notes 58 | 59 | If you get errors like this, it means that QEMU is not installed in host/container 60 | 61 | ![](image/filesystem-error.png) 62 | 63 | To configure QEMU, run below, either on host, or the running container. 64 | 65 | ```shell 66 | ./configure_qemu.sh 67 | ``` 68 | -------------------------------------------------------------------------------- /configure_qemu.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # Reference: https://github.com/MiroPsota/sdkmanagerGUI_docker 4 | 5 | sudo mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc 6 | sudo update-binfmts --enable qemu-aarch64 7 | sudo update-binfmts --enable qemu-arm 8 | sudo update-binfmts --enable qemu-armeb 9 | 10 | /bin/bash -------------------------------------------------------------------------------- /image/filesystem-error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atinfinity/sdk_manager_docker/73201572a2f4c62645afd8a07bc10e4707acecae/image/filesystem-error.png -------------------------------------------------------------------------------- /image/jetson-os-flash-setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atinfinity/sdk_manager_docker/73201572a2f4c62645afd8a07bc10e4707acecae/image/jetson-os-flash-setting.png -------------------------------------------------------------------------------- /launch_container.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | XSOCK=/tmp/.X11-unix 4 | XAUTH=/tmp/.docker.xauth 5 | touch $XAUTH 6 | xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge - 7 | 8 | mkdir -p jetpack_home/nvidia 9 | mkdir -p jetpack_home/Downloads 10 | JETPACK_HOME=$(realpath ./jetpack_home) 11 | 12 | docker run --privileged --rm -it \ 13 | --volume=$XSOCK:$XSOCK:rw \ 14 | --volume=$XAUTH:$XAUTH:rw \ 15 | --volume=/dev:/dev:rw \ 16 | --volume="$JETPACK_HOME/nvidia":/home/jetpack/nvidia:rw \ 17 | --volume="$JETPACK_HOME/Downloads":/home/jetpack/Downloads:rw \ 18 | --shm-size=1gb \ 19 | --env="XAUTHORITY=${XAUTH}" \ 20 | --env="DISPLAY=${DISPLAY}" \ 21 | --env=TERM=xterm-256color \ 22 | --env=QT_X11_NO_MITSHM=1 \ 23 | --net=host \ 24 | -u "jetpack" \ 25 | jetpack:latest 26 | --------------------------------------------------------------------------------