1+ FROM ubuntu:24.04
2+
3+ ENV DEBIAN_FRONTEND=noninteractive
4+ ENV PYTHON_CONFIGURE_OPTS="--enable-shared"
5+ ENV PYENV_ROOT="/opt/pyenv"
6+ ENV PATH="$PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH"
7+
8+ # Install system dependencies for pyenv and Python builds
9+ RUN apt-get update && apt-get install -yqq \
10+ libncurses5-dev \
11+ libgtk2.0-dev \
12+ libatk1.0-dev \
13+ libcairo2-dev \
14+ libx11-dev \
15+ libxpm-dev \
16+ libxt-dev \
17+ lua5.2 \
18+ liblua5.2-dev \
19+ libperl-dev \
20+ git \
21+ build-essential \
22+ curl \
23+ wget \
24+ ca-certificates \
25+ libssl-dev \
26+ libbz2-dev \
27+ libreadline-dev \
28+ libsqlite3-dev \
29+ zlib1g-dev \
30+ libffi-dev \
31+ liblzma-dev \
32+ && rm -rf /var/lib/apt/lists/*
33+
34+ # Remove existing vim packages
35+ RUN apt-get remove --purge -yqq vim vim-runtime gvim || true
36+
37+ # Install pyenv
38+ RUN git clone https://github.com/pyenv/pyenv.git $PYENV_ROOT && \
39+ cd $PYENV_ROOT && \
40+ git checkout $(git describe --tags --abbrev=0)
41+
42+ # Install Python versions with pyenv
43+ RUN pyenv install 3.10.13 && \
44+ pyenv install 3.11.9 && \
45+ pyenv install 3.12.4 && \
46+ pyenv install 3.13.0
47+
48+ ARG PYTHON_VERSION=3.10.13
49+ ENV PYTHON_VERSION=${PYTHON_VERSION}
50+ RUN pyenv global ${PYTHON_VERSION}
51+
52+ # Create virtual environment
53+ RUN python -m venv /opt/venv
54+ ENV PATH="/opt/venv/bin:$PATH"
55+ ENV VIRTUAL_ENV="/opt/venv"
56+
57+ # Upgrade pip in the virtual environment
58+ RUN pip install --upgrade pip setuptools wheel
59+
60+ # Dependency to load some modules within pyton-mode
61+ RUN pip install pytoolconfig
0 commit comments