Skip to content

Commit 7a00deb

Browse files
committed
add: Python 3.10 on Ubuntu 20.04 Dockerfile
* Note: DO NOT USE IT until Python 3.10.1 comes out. It contains many bugfixes.
1 parent d2943e2 commit 7a00deb

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

python/Dockerfile.3.10-ubuntu20.04

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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.10 python3.10-dev python3.10-distutils && \
25+
apt-get install -y cmake && \
26+
apt-get clean && \
27+
rm -rf /var/lib/apt/lists/
28+
29+
ENV PYTHONUNBUFFERED=1 \
30+
PATH=/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
31+
LANG=C.UTF-8
32+
33+
RUN curl https://bootstrap.pypa.io/get-pip.py | python3.10 && \
34+
python3.10 -m pip install --upgrade pip && \
35+
python3.10 -m pip install --no-cache-dir -U setuptools && \
36+
python3.10 -m pip install --no-cache-dir h5py && \
37+
python3.10 -m pip install --no-cache-dir Cython && \
38+
python3.10 -m pip install --no-cache-dir matplotlib bokeh && \
39+
python3.10 -m pip install --no-cache-dir versioneer && \
40+
python3.10 -m pip install --no-cache-dir pyproj Cartopy && \
41+
python3.10 -m pip install --no-cache-dir pandas && \
42+
python3.10 -m pip install --no-cache-dir seaborn && \
43+
python3.10 -m pip install --no-cache-dir pillow && \
44+
python3.10 -m pip install --no-cache-dir networkx cvxpy && \
45+
python3.10 -m pip install --no-cache-dir scikit-learn scikit-image && \
46+
python3.10 -m pip install --no-cache-dir pygments && \
47+
python3.10 -m pip install --no-cache-dir ipython && \
48+
python3.10 -m pip install --no-cache-dir jupyter && \
49+
python3.10 -m pip install --no-cache-dir jupyterlab && \
50+
rm -rf /root/.cache && \
51+
rm -f /tmp/*.whl
52+
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 2
53+
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2
54+
55+
# Install ipython kernelspec
56+
RUN python3.10 -m ipykernel install --display-name "Python 3.10 on Backend.AI" && \
57+
cat /usr/local/share/jupyter/kernels/python3/kernel.json
58+
59+
# Backend.AI specifics
60+
LABEL ai.backend.kernelspec="1" \
61+
ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \
62+
ai.backend.features="batch query uid-match user-input" \
63+
ai.backend.resource.min.cpu="1" \
64+
ai.backend.resource.min.mem="256m" \
65+
ai.backend.base-distro="ubuntu20.04" \
66+
ai.backend.runtime-type="python" \
67+
ai.backend.runtime-path="/usr/bin/python3" \
68+
ai.backend.service-ports="ipython:pty:3000,jupyter:http:8070,jupyterlab:http:8090"
69+
COPY policy.yml /etc/backend.ai/jail/policy.yml
70+
71+
# vim: ft=dockerfile

0 commit comments

Comments
 (0)