Skip to content

Start building a new docker based test flow #1186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/build_base_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Push Base Docker Image

on:
push:
branches: [main]
paths:
- 'Dockerfile.base'
- '.github/workflows/build_base_image.yml'
workflow_dispatch:

jobs:
build-and-push-base:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract repo name
id: repo
run: |
echo "REPO=${GITHUB_REPOSITORY,,}" >> $GITHUB_OUTPUT

- name: Build and push base image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.base
push: true
tags: |
ghcr.io/${{ steps.repo.outputs.REPO }}-base:latest
61 changes: 61 additions & 0 deletions Dockerfile.base
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
FROM ubuntu:24.04

ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHON_CONFIGURE_OPTS="--enable-shared"
ENV PYENV_ROOT="/opt/pyenv"
ENV PATH="$PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH"

# Install system dependencies for pyenv and Python builds
RUN apt-get update && apt-get install -yqq \
libncurses5-dev \
libgtk2.0-dev \
libatk1.0-dev \
libcairo2-dev \
libx11-dev \
libxpm-dev \
libxt-dev \
lua5.2 \
liblua5.2-dev \
libperl-dev \
git \
build-essential \
curl \
wget \
ca-certificates \
libssl-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
zlib1g-dev \
libffi-dev \
liblzma-dev \
&& rm -rf /var/lib/apt/lists/*

# Remove existing vim packages
RUN apt-get remove --purge -yqq vim vim-runtime gvim || true

# Install pyenv
RUN git clone https://github.com/pyenv/pyenv.git $PYENV_ROOT && \
cd $PYENV_ROOT && \
git checkout $(git describe --tags --abbrev=0)

# Install Python versions with pyenv
RUN pyenv install 3.10.13 && \
pyenv install 3.11.9 && \
pyenv install 3.12.4 && \
pyenv install 3.13.0

ARG PYTHON_VERSION=3.10.13
ENV PYTHON_VERSION=${PYTHON_VERSION}
RUN pyenv global ${PYTHON_VERSION}

# Create virtual environment
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
ENV VIRTUAL_ENV="/opt/venv"

# Upgrade pip in the virtual environment
RUN pip install --upgrade pip setuptools wheel

# Dependency to load some modules within pyton-mode
RUN pip install pytoolconfig
Loading