1 # DESCRIPTION: Python 3.10.2 container
2 # AUTHOR: https://github.com/r1w1s1
4 # Python 3.10.2 based on Ubuntu 20.04
7 # # Download Dockerfile
8 # wget https://raw.githubusercontent.com/r1w1s1/dockerfiles/master/python-3.10.2/Dockerfile
11 # docker build -t python-3.10.2-ubuntu:20.04 .
14 # docker run -it python-3.10.2-ubuntu:20.04
17 FROM ubuntu:20.04 AS builder
19 ENV DEBIAN_FRONTEND=noninteractive
21 RUN echo "deb-src http://archive.ubuntu.com/ubuntu/ focal main" >> /etc/apt/sources.list \
23 && apt -y build-dep python3 \
24 && apt -y install curl gdb lcov libbz2-dev libffi-dev libgdbm-dev \
25 libgdbm-compat-dev liblzma-dev libncurses5-dev libreadline6-dev \
26 libsqlite3-dev libssl-dev lzma lzma-dev tk-dev uuid-dev zlib1g-dev \
27 && curl -o /root/Python-3.10.2.tgz https://www.python.org/ftp/python/3.10.2/Python-3.10.2.tgz \
29 && tar xzf Python-3.10.2.tgz \
31 && ./configure --enable-optimizations \
33 && ln -s /usr/local/bin/python3.10 /usr/bin \
34 && ln -s /usr/local/bin/pip3.10 /usr/bin
38 COPY --from=builder /usr/local/ /usr/local/
40 RUN ln -s /usr/local/bin/python3.10 /usr/bin/python3 \
41 && ln -s /usr/local/bin/pip3.10 /usr/bin/pip3