diff --git a/gpu_docker/Dockerfile b/gpu_docker/Dockerfile index 924d04f97..e95cf4f22 100644 --- a/gpu_docker/Dockerfile +++ b/gpu_docker/Dockerfile @@ -1,4 +1,5 @@ -FROM nvcr.io/nvidia/cuda:11.0.3-devel +ARG NVIDIAVERSION=11.0.3-devel +FROM nvidia/cuda:${NVIDIAVERSION} SHELL ["/bin/bash", "-c"] @@ -6,7 +7,7 @@ ENV DEBIAN_FRONTEND=noninteractive # upgrade RUN rm /etc/apt/sources.list.d/cuda.list -RUN rm /etc/apt/sources.list.d/nvidia-ml.list +RUN rm -f /etc/apt/sources.list.d/nvidia-ml.list RUN apt update && \ apt install --assume-yes apt-transport-https \ ca-certificates gnupg \ @@ -17,10 +18,10 @@ RUN apt-add-repository "deb https://apt.kitware.com/ubuntu/ focal main" RUN apt install -y cmake libncurses5-dev libtinfo6 # Anaconda -RUN cd /opt && wget -P /tmp https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-x86_64.sh \ - && bash /tmp/Anaconda3-2022.10-Linux-x86_64.sh -b -p /opt/anaconda \ - && rm -rf /tmp/Anaconda3-2022.10-Linux-x86_64.sh \ - && eval "$(/opt/anaconda/bin/conda shell.bash hook)" +RUN wget -P /tmp https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-x86_64.sh +RUN bash /tmp/Anaconda3-2022.10-Linux-x86_64.sh -b -p /opt/anaconda +RUN rm -rf /tmp/Anaconda3-2022.10-Linux-x86_64.sh +RUN cd /opt && eval "$(/opt/anaconda/bin/conda shell.bash hook)" ENV PATH /opt/anaconda/bin:${PATH} ENV LD_LIBRARY_PATH /opt/anaconda/lib:${LD_LIBRARY_PATH} diff --git a/gpu_docker/docker-build.sh b/gpu_docker/docker-build.sh index 4298dbdba..e82a8f9c4 100644 --- a/gpu_docker/docker-build.sh +++ b/gpu_docker/docker-build.sh @@ -1,11 +1,21 @@ COMMIT=${1} COMMIT="$(echo "${COMMIT}" | tr -d '[:space:]')" export COMMIT -NO_TAG="ghcr.io/${2}/pyafq_gpu" + +NO_TAG="ghcr.io/${2}/pyafq_gpu_cuda_11" TAG="${NO_TAG}:${COMMIT}" TAG2="${NO_TAG}:latest" TAG="$(echo "${TAG}" | tr -d '[:space:]')" TAG2="$(echo "${TAG2}" | tr -d '[:space:]')" - echo $TAG docker build --no-cache -t $TAG -t $TAG2 --build-arg COMMIT ./gpu_docker + +NVIDIAVERSION="12.0.1-devel-ubuntu20.04" +export NVIDIAVERSION +NO_TAG="ghcr.io/${2}/pyafq_gpu_cuda_12" +TAG="${NO_TAG}:${COMMIT}" +TAG2="${NO_TAG}:latest" +TAG="$(echo "${TAG}" | tr -d '[:space:]')" +TAG2="$(echo "${TAG2}" | tr -d '[:space:]')" +echo $TAG +docker build --no-cache -t $TAG -t $TAG2 --build-arg COMMIT --build-arg NVIDIAVERSION ./gpu_docker diff --git a/gpu_docker/docker-push.sh b/gpu_docker/docker-push.sh index 3cd1c29e8..6198ddff1 100644 --- a/gpu_docker/docker-push.sh +++ b/gpu_docker/docker-push.sh @@ -1,4 +1,9 @@ -NO_TAG="ghcr.io/${1}/pyafq_gpu" +NO_TAG="ghcr.io/${1}/pyafq_gpu_cuda_11" +NO_TAG="$(echo "${NO_TAG}" | tr -d '[:space:]')" + +docker push --all-tags $NO_TAG + +NO_TAG="ghcr.io/${1}/pyafq_gpu_cuda_12" NO_TAG="$(echo "${NO_TAG}" | tr -d '[:space:]')" docker push --all-tags $NO_TAG