-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
92 lines (77 loc) · 3.32 KB
/
Dockerfile
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
ARG base=ubuntu:20.04
FROM tensorchord/envd-sshd-from-scratch:v0.3.11 as sshd
FROM tensorchord/horust:v0.2.1 as horust
FROM tensorchord/starship:v0.0.1 as starship
FROM ${base}
ENV DEBIAN_FRONTEND=noninteractive LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8
RUN apt-get update && apt-get install -y apt-utils && \
apt-get install -y --no-install-recommends --fix-missing \
bash-static \
libtinfo5 \
libncursesw5 \
bzip2 \
ca-certificates \
git \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender1 \
mercurial \
openssh-client \
procps \
subversion \
wget \
curl \
make \
sudo \
vim \
zsh \
locales \
&& rm -rf /var/lib/apt/lists/*
RUN locale-gen en_US.UTF-8
ENV PATH /opt/conda/bin:$PATH
ARG CONDA_VERSION=py39_4.11.0
RUN set -x && \
UNAME_M="$(uname -m)" && \
if [ "${UNAME_M}" = "x86_64" ]; then \
MINICONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh"; \
SHA256SUM="4ee9c3aa53329cd7a63b49877c0babb49b19b7e5af29807b793a76bdb1d362b4"; \
elif [ "${UNAME_M}" = "s390x" ]; then \
MINICONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-${CONDA_VERSION}-Linux-s390x.sh"; \
SHA256SUM="e5e5e89cdcef9332fe632cd25d318cf71f681eef029a24495c713b18e66a8018"; \
elif [ "${UNAME_M}" = "aarch64" ]; then \
MINICONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-${CONDA_VERSION}-Linux-aarch64.sh"; \
SHA256SUM="00c7127a8a8d3f4b9c2ab3391c661239d5b9a88eafe895fd0f3f2a8d9c0f4556"; \
elif [ "${UNAME_M}" = "ppc64le" ]; then \
MINICONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-${CONDA_VERSION}-Linux-ppc64le.sh"; \
SHA256SUM="8ee1f8d17ef7c8cb08a85f7d858b1cb55866c06fcf7545b98c3b82e4d0277e66"; \
fi && \
wget "${MINICONDA_URL}" -O miniconda.sh -q && \
echo "${SHA256SUM} miniconda.sh" > shasum && \
if [ "${CONDA_VERSION}" != "latest" ]; then sha256sum --check --status shasum; fi && \
mkdir -p /opt/conda && \
sh miniconda.sh -b -u -p /opt/conda && \
rm miniconda.sh shasum && \
touch ~/.bashrc && \
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
echo "conda activate base" >> ~/.bashrc && \
echo -e "channels:\n - defaults" > /opt/conda/.condarc && \
find /opt/conda/ -follow -type f -name '*.a' -delete && \
find /opt/conda/ -follow -type f -name '*.js.map' -delete && \
/opt/conda/bin/conda clean -afy
RUN conda create -n envd python=3.9
ENV ENVD_PREFIX=/opt/conda/envs/envd/bin
RUN update-alternatives --install /usr/bin/python python ${ENVD_PREFIX}/python 1 && \
update-alternatives --install /usr/bin/python3 python3 ${ENVD_PREFIX}/python3 1 && \
update-alternatives --install /usr/bin/pip pip ${ENVD_PREFIX}/pip 1 && \
update-alternatives --install /usr/bin/pip3 pip3 ${ENVD_PREFIX}/pip3 1
RUN ${ENVD_PREFIX}/pip install ipython numpy
COPY --from=sshd /usr/bin/envd-sshd /var/envd/bin/envd-sshd
COPY --from=horust / /usr/local/bin/
COPY --from=starship /usr/local/bin/starship /usr/local/bin/starship
RUN groupadd -g 1000 envd && \
useradd -p "" -u 1000 -g envd -s /bin/sh -m envd && \
usermod -a -G sudo envd && \
install -d -o envd -g 1000 -m 0700 /home/envd/.config /home/envd/.cache
USER envd
WORKDIR /home/envd