File tree 2 files changed +19
-9
lines changed
2 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -16,15 +16,24 @@ setup_mamba() {
16
16
17
17
18
18
setup_conda_postprocess () {
19
+ ln -sf ${CONDA_PREFIX} /bin/python3 /usr/bin/python
20
+
19
21
# If python exists, set pypi source
20
22
if [ -f " $( which python) " ]; then
21
23
cat > /etc/pip.conf << EOF
22
24
[global]
23
25
progress_bar=off
24
26
root-user-action=ignore
27
+ # retries=5
28
+ # timeout=10
29
+ trusted-host=pypi.python.org pypi.org files.pythonhosted.org
30
+ # index-url=https://pypi.python.org/simple
25
31
EOF
26
32
fi
27
33
34
+ export PATH=$PATH :${CONDA_PREFIX} /bin
35
+ printenv | sort
36
+
28
37
conda config --system --prepend channels conda-forge \
29
38
&& conda config --system --set auto_update_conda false \
30
39
&& conda config --system --set show_channel_urls true \
42
51
}
43
52
44
53
setup_conda_with_mamba () {
54
+ mkdir -pv ${CONDA_PREFIX}
45
55
VERSION_PYTHON=$1 ; shift 1;
46
56
mamba install -y --root-prefix=" ${CONDA_PREFIX} " --prefix=" ${CONDA_PREFIX} " -c " conda-forge" conda pip python=" ${VERSION_PYTHON:- 3.10} "
47
- rm -rf /opt/conda /pkgs/*
57
+ rm -rf ${CONDA_PREFIX} /pkgs/*
48
58
setup_conda_postprocess
49
59
}
50
60
51
61
setup_conda_download () {
62
+ mkdir -pv ${CONDA_PREFIX}
52
63
wget -qO- " https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-$( arch) .sh" -O /tmp/conda.sh
53
- bash /tmp/conda.sh -f -b -p /opt/conda
64
+ bash /tmp/conda.sh -f -b -p ${CONDA_PREFIX} /
54
65
rm -rf /tmp/conda.sh
55
66
setup_conda_postprocess
56
67
}
Original file line number Diff line number Diff line change @@ -6,18 +6,17 @@ FROM ${BASE_NAMESPACE:+$BASE_NAMESPACE/}${BASE_IMG}
6
6
7
7
LABEL maintainer="haobibo@gmail.com"
8
8
9
- ENV CONDA_PREFIX=/opt/conda/ \
10
- PATH=/opt/conda/bin: $PATH
9
+ ENV CONDA_PREFIX=/opt/conda \
10
+ PATH=$PATH:${CONDA_PREFIX}/bin
11
11
12
- RUN source /opt/utils/script-utils .sh \
13
- && source /opt/utils/script-setup .sh \
12
+ RUN source /opt/utils/script-setup .sh \
13
+ # # source /opt/utils/script-utils .sh # already included in the `script-setup.sh`
14
14
&& install_apt /opt/utils/install_list_base.apt \
15
15
&& echo "Install tini" \
16
16
&& setup_tini \
17
17
&& echo "Install Mamba, Python, and Conda:" \
18
- && mkdir -pv ${CONDA_PREFIX} \
19
- && setup_mamba && setup_conda_with_mamba && install__clean \
20
- && ln -sf /opt/conda/bin/python3 /usr/bin/python
18
+ && setup_mamba && setup_conda_with_mamba && install__clean
19
+
21
20
# && echo "Replace system Python3 with Conda's Python - note that /bin and /sbin are symlinks of /usr/bin in docker image ubuntu" \
22
21
# && ln -sf /opt/conda/lib/python3.10 /opt/conda/lib/python3 \
23
22
# && cp --verbose -rn /usr/lib/python3.*/* /opt/conda/lib/python3/ \
You can’t perform that action at this time.
0 commit comments