Skip to content

Commit d93229f

Browse files
committed
add: Python 3.8 multi-arch based on ubuntu 20.04
1 parent 028dfa0 commit d93229f

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

python/Dockerfile.3.8-ubuntu20.04

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
FROM ubuntu:20.04
2+
# Ubuntu 20.04 comes with Python 3.8
3+
ENV DEBIAN_FRONTEND noninteractive
4+
RUN apt-get update && \
5+
apt-get install -y \
6+
ca-certificates apt-utils \
7+
wget curl git-core \
8+
vim-tiny zip unzip \
9+
libssl-dev \
10+
libmpdec2 \
11+
proj-bin libproj-dev \
12+
libgeos-dev libgeos++-dev \
13+
mime-support \
14+
gcc g++ \
15+
cmake ncurses-term && \
16+
ln -sf /usr/share/terminfo/x/xterm-color /usr/share/terminfo/x/xterm-256color && \
17+
apt-get clean && \
18+
rm -rf /var/lib/apt/lists/
19+
20+
RUN apt-get update && \
21+
apt-get install -y software-properties-common && \
22+
add-apt-repository ppa:deadsnakes/ppa && \
23+
apt-get update && \
24+
apt-get install -y python3.8 python3.8-dev python3.8-distutils && \
25+
apt-get clean && \
26+
rm -rf /var/lib/apt/lists/
27+
28+
RUN apt-get update && \
29+
apt-get install -y libopenblas-dev && \
30+
apt-get clean && \
31+
rm -rf /var/lib/apt/lists/
32+
33+
ENV PYTHONUNBUFFERED=1 \
34+
PATH=/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
35+
LANG=C.UTF-8
36+
37+
# Cartopy>=0.20 requires proj>=8.0.0 but it will ship on Ubuntu 22.04.
38+
RUN curl https://bootstrap.pypa.io/get-pip.py | python3.8 && \
39+
python3.8 -m pip install --no-cache-dir -U setuptools && \
40+
python3.8 -m pip install --no-cache-dir h5py && \
41+
python3.8 -m pip install --no-cache-dir Cython && \
42+
python3.8 -m pip install --no-cache-dir matplotlib bokeh && \
43+
python3.8 -m pip install --no-cache-dir versioneer && \
44+
python3.8 -m pip install --no-cache-dir pyproj cartopy==0.19.0.post1 && \
45+
python3.8 -m pip install --no-cache-dir pandas && \
46+
python3.8 -m pip install --no-cache-dir seaborn && \
47+
python3.8 -m pip install --no-cache-dir pillow && \
48+
python3.8 -m pip install --no-cache-dir networkx cvxpy && \
49+
python3.8 -m pip install --no-cache-dir scikit-learn scikit-image && \
50+
python3.8 -m pip install --no-cache-dir pygments && \
51+
python3.8 -m pip install --no-cache-dir ipython && \
52+
python3.8 -m pip install --no-cache-dir jupyter && \
53+
python3.8 -m pip install --no-cache-dir jupyterlab && \
54+
rm -rf /root/.cache && \
55+
rm -f /tmp/*.whl
56+
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.8 2
57+
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2
58+
59+
# Install ipython kernelspec
60+
RUN python3.8 -m ipykernel install --display-name "Python 3.8 on Backend.AI" && \
61+
cat /usr/local/share/jupyter/kernels/python3/kernel.json
62+
63+
# Backend.AI specifics
64+
COPY ./service-defs /etc/backend.ai/service-defs
65+
LABEL ai.backend.kernelspec="1" \
66+
ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \
67+
ai.backend.features="batch query uid-match user-input" \
68+
ai.backend.resource.min.cpu="1" \
69+
ai.backend.resource.min.mem="256m" \
70+
ai.backend.base-distro="ubuntu20.04" \
71+
ai.backend.runtime-type="python" \
72+
ai.backend.runtime-path="/usr/bin/python3" \
73+
ai.backend.service-ports="ipython:pty:3000,jupyter:http:8070,jupyterlab:http:8090"
74+
COPY policy.yml /etc/backend.ai/jail/policy.yml
75+
76+
# vim: ft=dockerfile

0 commit comments

Comments
 (0)