Skip to content

Commit bec18d5

Browse files
committed
Start building a new docker based test flow
1 parent 89ebed5 commit bec18d5

File tree

2 files changed

+104
-0
lines changed

2 files changed

+104
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Build and Push Base Docker Image
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'Dockerfile.base'
8+
- '.github/workflows/build_base_image.yml'
9+
workflow_dispatch:
10+
11+
jobs:
12+
build-and-push-base:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@v3
23+
24+
- name: Log in to GitHub Container Registry
25+
uses: docker/login-action@v3
26+
with:
27+
registry: ghcr.io
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Extract repo name
32+
id: repo
33+
run: |
34+
echo "REPO=${GITHUB_REPOSITORY,,}" >> $GITHUB_OUTPUT
35+
36+
- name: Build and push base image
37+
uses: docker/build-push-action@v5
38+
with:
39+
context: .
40+
file: Dockerfile.base
41+
push: true
42+
tags: |
43+
ghcr.io/${{ steps.repo.outputs.REPO }}-base:latest

Dockerfile.base

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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

Comments
 (0)