Last active
April 22, 2024 18:39
-
-
Save NimaMX/c4f1d9171c48f92c6b212ccff8a9d42c to your computer and use it in GitHub Desktop.
dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM docker | |
COPY --from=docker/buildx-bin /buildx /usr/libexec/docker/cli-plugins/docker-buildx | |
RUN docker buildx version | |
# | |
# Base Image from Ubuntu 18.04 | |
# | |
FROM docker.io/library/ubuntu:bionic-20210615.1 | |
# | |
# Installing Cuda 10.2 | |
# | |
FROM nvcr.io/nvidia/l4t-base:r32.7.1 | |
# Create the user | |
ENV DEBIAN_FRONTEND=noninteractive | |
ENV LC_ALL=C.UTF-8 | |
ENV UDEV=off | |
ARG USERNAME=nvuser | |
ARG USER_UID=1000 | |
ARG USER_GID=$USER_UID | |
# RUN echo 'DPkg::options { "--force-confdef"; };' >> /etc/apt/apt.conf | |
RUN groupadd --gid $USER_GID $USERNAME \ | |
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ | |
&& apt-get update \ | |
&& apt-get install -y sudo \ | |
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ | |
&& chmod 0440 /etc/sudoers.d/$USERNAME | |
# | |
# Install base software | |
# | |
RUN apt-get update && apt-get install -y -qq --no-install-recommends \ | |
apt-utils \ | |
nano \ | |
vim \ | |
git \ | |
gnupg2 \ | |
gnupg \ | |
software-properties-common \ | |
bash-completion \ | |
build-essential \ | |
ca-certificates \ | |
cmake \ | |
curl \ | |
g++ \ | |
gcc \ | |
git \ | |
libbz2-dev \ | |
libboost-all-dev \ | |
libgsm1-dev \ | |
libltdl-dev \ | |
liblzma-dev \ | |
libmagic-dev \ | |
libpng-dev \ | |
libsox-fmt-mp3 \ | |
libsox-dev \ | |
locales \ | |
openjdk-8-jdk \ | |
pkg-config \ | |
python3 \ | |
python3-dev \ | |
python3-pip \ | |
python3-wheel \ | |
python3-numpy \ | |
sox \ | |
unzip \ | |
wget \ | |
python3-venv \ | |
xz-utils \ | |
zlib1g-dev | |
RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 | |
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 | |
ADD --chown=root:root https://repo.download.nvidia.com/jetson/jetson-ota-public.asc /etc/apt/trusted.gpg.d/jetson-ota-public.asc | |
RUN chmod 644 /etc/apt/trusted.gpg.d/jetson-ota-public.asc \ | |
&& apt-get update && apt-get install -y --no-install-recommends ca-certificates \ | |
&& echo "deb https://repo.download.nvidia.com/jetson/common r32.7 main" > /etc/apt/sources.list.d/nvidia-l4t-apt-source.list \ | |
&& echo "deb https://repo.download.nvidia.com/jetson/t210 r32.7 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list \ | |
&& mkdir -p /opt/nvidia/l4t-packages \ | |
&& touch /opt/nvidia/l4t-packages/.nv-l4t-disable-boot-fw-update-in-preinstall \ | |
&& apt-get update | |
# | |
# Installing Cudnn | |
# | |
RUN apt update && apt install -y --assume-yes -o Dpkg::Options::="--force-confdef" \ | |
jetson-gpio-common \ | |
nvidia-cuda \ | |
nvidia-cudnn8 \ | |
nvidia-tensorrt \ | |
nvidia-l4t-tools \ | |
nvidia-l4t-jetson-io \ | |
nvidia-l4t-configs \ | |
nvidia-l4t-oem-config | |
# | |
# Installing Bazel | |
# | |
RUN wget https://github.com/bazelbuild/bazel/releases/download/3.7.2/bazel-3.7.2-linux-arm64 | |
RUN chmod +x bazel-3.7.2-linux-arm64 | |
RUN mv bazel-3.7.2-linux-arm64 /usr/bin/bazel | |
# create some soft links | |
RUN ln -s /usr/local/cuda-10.2/targets/aarch64-linux/lib/stubs/libcuda.so /usr/local/cuda-10.2/lib64/libcuda.so | |
#RUN ln -s /usr/local/cuda-10.2/lib64/libcudart.so.10.2 /usr/local/cuda-10.2/lib64/libcudart.so | |
# | |
# Update libraries | |
# | |
RUN ldconfig | |
# | |
# Setup environment variables | |
# | |
ENV CUDA_HOME="/usr/local/cuda" | |
ENV PATH="/usr/local/cuda/bin:${PATH}" | |
ENV LD_LIBRARY_PATH="/usr/local/cuda/lib64:${LD_LIBRARY_PATH}" | |
WORKDIR /home | |
ENV UDEV=1 | |
CMD ["bash"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment