Skip to content

Instantly share code, notes, and snippets.

@cybertramp
Last active January 17, 2024 06:07
Show Gist options
  • Save cybertramp/8af51a542567ede47665c25d72efab31 to your computer and use it in GitHub Desktop.
Save cybertramp/8af51a542567ede47665c25d72efab31 to your computer and use it in GitHub Desktop.
jenkins with Python 3.11 in Dockerfile
FROM jenkins/jenkins:lts
USER root
RUN mkdir -p /tmp/python_build && \
apt update && \
apt-get install -y \
build-essential \
zlib1g-dev \
libncurses5-dev \
libgdbm-dev \
libnss3-dev \
libssl-dev \
libreadline-dev \
libffi-dev \
libsqlite3-dev \
wget \
libbz2-dev \
sshpass && \
cd /tmp/python_build && \
wget https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tgz && \
tar -xf Python-3.11.0.tgz && \
cd Python-3.11.0 && \
./configure --enable-optimizations && \
make -j 12 && make altinstall && \
update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.11 1 && \
rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED && \
apt install -y python3-pip && \
pip3 install --upgrade pip --break-system-packages && \
curl -sSL https://install.python-poetry.org | python3 - && \
export PATH="$HOME/.local/bin:$PATH"
EXPOSE 8080
@cybertramp
Copy link
Author

Verification

  • Alma Linux amd64 9.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment