Skip to content

Commit

Permalink
update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
felixdittrich92 committed May 12, 2024
1 parent bb16d11 commit e0584a4
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1

ARG SYSTEM=gpu
# NOTE: The following CUDA_VERSION, CUDNN_VERSION, and NVINFER_VERSION are for CUDA 11.8
# - this needs to match exactly with the host system otherwise the onnxruntime-gpu package isn't able to work correct. !!
ARG CUDA_VERSION=11-8
ARG CUDNN_VERSION=8.6.0.163-1
ARG NVINFER_VERSION=8.6.1.6-1

# Enroll NVIDIA GPG public key and install CUDA
RUN if [ "$SYSTEM" = "gpu" ]; then \

Check notice on line 11 in Dockerfile

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

Dockerfile#L11

Avoid additional packages by specifying `--no-install-recommends`

Check notice on line 11 in Dockerfile

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

Dockerfile#L11

Delete the apt-get lists after installing something

Check warning on line 11 in Dockerfile

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

Dockerfile#L11

Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
Expand All @@ -21,22 +16,24 @@ RUN if [ "$SYSTEM" = "gpu" ]; then \
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb && \
dpkg -i cuda-keyring_1.1-1_all.deb && \
apt-get update && apt-get install -y --no-install-recommends \
# NOTE: The following CUDA_VERSION, CUDNN_VERSION, and NVINFER_VERSION are for CUDA 11.8
# - this needs to match exactly with the host system otherwise the onnxruntime-gpu package isn't able to work correct. !!
cuda-command-line-tools-11-8 \
cuda-cudart-dev-${CUDA_VERSION} \
cuda-nvcc-${CUDA_VERSION} \
cuda-cupti-${CUDA_VERSION} \
cuda-nvprune-${CUDA_VERSION} \
cuda-libraries-${CUDA_VERSION} \
cuda-nvrtc-${CUDA_VERSION} \
libcufft-${CUDA_VERSION} \
libcurand-${CUDA_VERSION} \
libcusolver-${CUDA_VERSION} \
libcusparse-${CUDA_VERSION} \
libcublas-${CUDA_VERSION} \
cuda-cudart-dev-11-8 \
cuda-nvcc-11-8 \
cuda-cupti-11-8 \
cuda-nvprune-11-8 \
cuda-libraries-11-8 \
cuda-nvrtc-11-8 \
libcufft-11-8 \
libcurand-11-8 \
libcusolver-11-8 \
libcusparse-11-8 \
libcublas-11-8 \
# - CuDNN: https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#ubuntu-network-installation
libcudnn${CUDNN_VERSION%%.*}=${CUDNN_VERSION}+cuda${CUDA_VERSION.replace('-', '.')}; \
libnvinfer-plugin${CUDNN_VERSION%%.*}=${NVINFER_VERSION}+cuda${CUDA_VERSION.replace('-', '.')}; \
libnvinfer${CUDNN_VERSION%%.*}=${NVINFER_VERSION}+cuda${CUDA_VERSION.replace('-', '.')}; \
libcudnn8=8.6.0.163-1+cuda11.8 \
libnvinfer-plugin8=8.6.1.6-1+cuda11.8 \
libnvinfer8=8.6.1.6-1+cuda11.8; \
fi

RUN apt-get update && apt-get install -y --no-install-recommends \

Check warning on line 39 in Dockerfile

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

Dockerfile#L39

Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`

Check notice on line 39 in Dockerfile

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

Dockerfile#L39

Use semicolon or linefeed before 'fi' (or quote to make it literal).
Expand Down

0 comments on commit e0584a4

Please sign in to comment.