-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile.conda
More file actions
46 lines (40 loc) · 1.93 KB
/
Dockerfile.conda
File metadata and controls
46 lines (40 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
ARG PYTHON_VERSION=3.9
ARG CIRCLE_PULL_REQUEST
FROM deepnote/python:base
RUN apt-get update && \
apt-get install -y --no-install-recommends \
tini \
libglib2.0-0 libxext6 libsm6 libxrender1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENV CONDA_PLUGINS_AUTO_ACCEPT_TOS=yes
ENV CONDA_ALWAYS_YES=true
# We always download and install the latest miniconda3,
# and then downgrade python to specific version.
# We could instead download a specific miniconda3 version,
# but that would require baking in the URLs for
# different Miniconda installer versions into the Dockerfile.
ARG PYTHON_VERSION
ARG TARGETARCH
RUN case "$TARGETARCH" in \
amd64) MINICONDA_ARCH="x86_64" ;; \
arm64) MINICONDA_ARCH="aarch64" ;; \
*) echo "Unsupported TARGETARCH: $TARGETARCH" >&2; exit 1 ;; \
esac && \
wget --quiet "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-${MINICONDA_ARCH}.sh" -O /tmp/miniconda.sh && \
/bin/bash /tmp/miniconda.sh -b -p /opt/conda && \
rm /tmp/miniconda.sh && \
# Use community packages from conda-forge instead of Anaconda Inc. default channels
# which require accepting terms of service & using commercial license for orgs with more than 200 employees
/opt/conda/bin/conda config --add channels conda-forge && \
/opt/conda/bin/conda config --remove channels defaults || true && \
/opt/conda/bin/conda config --set channel_priority strict && \
# Install the correct version of python (as the time of writing, anaconda
# installed python 3.11 by default) for parity with our base image
/opt/conda/bin/conda install python=${PYTHON_VERSION} && \
/opt/conda/bin/conda clean --all
ENV PATH=/opt/conda/bin:$PATH
ENV PIP_TARGET=/opt/conda/lib/python${PYTHON_VERSION}/site-packages
# Remove the system wide .profile file, because it overwrites the $PATH variable
# and therefore the /opt/conda/bin directory is not in the $PATH.
RUN rm /etc/profile