Skip to content

Commit 231e36e

Browse files
authored
feat: optimize Docker image size (#6)
1 parent 6f3b8c3 commit 231e36e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22
ARG PYTHON_VERSION=3.8
3-
FROM python:$PYTHON_VERSION-slim AS base
3+
FROM python:$PYTHON_VERSION-slim
44

55
# Install wget.
66
RUN apt-get update && \
@@ -11,7 +11,8 @@ RUN apt-get update && \
1111
# Install Miniconda.
1212
RUN CONDA_ARCH=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "x86_64") && \
1313
wget --quiet "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-$CONDA_ARCH.sh" --output-document ~/miniconda.sh && \
14-
/bin/bash ~/miniconda.sh -b -p /opt/conda
14+
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
15+
rm ~/miniconda.sh
1516
ENV PATH=/opt/conda/bin:$PATH
1617
ENV LD_LIBRARY_PATH=/opt/conda/lib:$LD_LIBRARY_PATH
1718

@@ -20,4 +21,5 @@ ARG CUDA_VERSION=11.8
2021
ARG CUDNN_VERSION=8.8
2122
RUN conda install --name base conda-libmamba-solver && \
2223
conda config --set solver libmamba && \
23-
conda install --channel conda-forge --yes cudatoolkit="$CUDA_VERSION" cudnn="$CUDNN_VERSION"
24+
conda install --name base --channel conda-forge --yes cudatoolkit="$CUDA_VERSION" cudnn="$CUDNN_VERSION" && \
25+
conda clean --all --force-pkgs-dirs --yes

0 commit comments

Comments
 (0)