diff --git a/.github/workflows/build_base_image.yml b/.github/workflows/build_base_image.yml new file mode 100644 index 00000000..ef1d7098 --- /dev/null +++ b/.github/workflows/build_base_image.yml @@ -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 \ No newline at end of file diff --git a/Dockerfile.base b/Dockerfile.base new file mode 100644 index 00000000..3b31a244 --- /dev/null +++ b/Dockerfile.base @@ -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 \ No newline at end of file
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: