Skip to content

Commit

Permalink
feat: optimize Docker image size (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
lsorber authored Sep 11, 2023
1 parent 6f3b8c3 commit 231e36e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
ARG PYTHON_VERSION=3.8
FROM python:$PYTHON_VERSION-slim AS base
FROM python:$PYTHON_VERSION-slim

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

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

0 comments on commit 231e36e

Please sign in to comment.