Pythonを追加するDockerfile
pyenvは部品を使うだけで最終的には削除します(Pythonは/usr/localに導入)
FROM ubuntu:bionicARG DEBIAN_FRONTEND=noninteractiveARG PYTHON_VERSION=3.9.0ARG PYTHON_ROOT=/usr/localARG PYENV_ROOT=/tmp/.pyenvARG PYBUILD_ROOT=/tmp/python-buildRUN apt update && apt install -y \build-essential \libssl-dev \zlib1g-dev \libbz2-dev \libreadline-dev \libsqlite3-dev \wget \curl \llvm \libncurses5-dev \libncursesw5-dev \xz-utils \tk-dev \libffi-dev \liblzma-dev \python-openssl \git \&& git clone https://github.com/pyenv/pyenv.git $PYENV_ROOT \&& PREFIX=$PYBUILD_ROOT $PYENV_ROOT/plugins/python-build/install.sh \&& $PYBUILD_ROOT/bin/python-build -v $PYTHON_VERSION $PYTHON_ROOT \&& rm -rf $PYBUILD_ROOT $PYENV_ROOT