diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 807fed3..85b995d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,13 @@ on: jobs: build: name: Build Dockerfile for amd64 and arm64 + strategy: + fail-fast: false + matrix: + autoconf_version: ["2.69", "2.71", "2.72"] runs-on: ubuntu-latest + env: + TAG: autoconf:${{ matrix.autoconf_version }}-${{ github.run_id }} steps: - name: Checkout Push to Registry action uses: actions/checkout@v4 @@ -22,7 +28,8 @@ jobs: uses: docker/build-push-action@v5 with: context: . - platforms: linux/amd64,linux/arm64 - push: false - tags: | - ghcr.io/corona10/cpython_autoconf + build-args: AUTOCONF_VERSION=${{ matrix.autoconf_version }} + load: true + tags: ${{ env.TAG }} + - name: Test + run: docker run --rm $TAG autoconf --version | grep ${{ matrix.autoconf_version }} diff --git a/Dockerfile b/Dockerfile index 396e41f..f2c52d4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,39 @@ FROM docker.io/library/alpine:3.19 +ARG AUTOCONF_VERSION="2.71" +ARG AUTOCONF_ARCHIVE_VERSION="2023.02.20" +ARG AUTOMAKE_VERSION="1.16.5" + LABEL org.opencontainers.image.source="https://github.com/corona10/cpython_autoconf" LABEL org.opencontainers.image.base.name="docker.io/library/alpine:3.19" LABEL org.opencontainers.image.authors="Donghee Na" -LABEL org.opencontainers.image.title="autoconf 2.72 container for CPython" -LABEL org.opencontainers.image.description="Container image with autoconf 2.72 tools to regenerate Python's configure script." +LABEL org.opencontainers.image.title="GNU Autoconf ${AUTOCONF_VERSION} container for CPython" +LABEL org.opencontainers.image.description="Container image with GNU Autoconf ${AUTOCONF_VERSION}, GNU Automake ${AUTOMAKE_VERSION}, and autoconf-archive ${AUTOCONF_ARCHIVE_VERSION} for generating CPython's configure script." RUN apk upgrade && \ apk add \ alpine-sdk \ autoconf \ automake \ - autoconf-archive \ - libtool \ - pkgconfig -RUN curl https://ftp.gnu.org/gnu/autoconf/autoconf-2.72.tar.gz | tar -zxvf - -RUN cd autoconf-2.72 && ./configure && make && make install + xz +RUN set -o pipefail \ + && curl https://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.gz | tar -zxf - \ + && cd autoconf-${AUTOCONF_VERSION} \ + && ./configure --prefix=/usr/local \ + && make \ + && make install +RUN set -o pipefail \ + && curl https://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.gz | tar -xzf - \ + && cd automake-${AUTOMAKE_VERSION} \ + && ./configure --prefix=/usr/local \ + && make \ + && make install +RUN set -o pipefail \ + && curl https://ftp.gnu.org/gnu/autoconf-archive/autoconf-archive-${AUTOCONF_ARCHIVE_VERSION}.tar.xz | xz -cd - | tar -xf - \ + && cd autoconf-archive-${AUTOCONF_ARCHIVE_VERSION} \ + && ./configure --prefix=/usr/local \ + && make \ + && make install VOLUME /src WORKDIR /src diff --git a/entry.sh b/entry.sh index 7f81d5b..3c0b077 100755 --- a/entry.sh +++ b/entry.sh @@ -1,21 +1,24 @@ #!/bin/sh set -e -SRC=/src -SENTINEL=${SRC}/pyconfig.h.in - -if [ ! -e ${SENTINEL} ]; then - echo "ERROR: ${SENTINEL} not found " - echo "Did you forget to mount Python work directory with '-v.:/src'?" - echo - echo " docker run -v.:/src dongheena/cpython_autoconf" - echo " podman run -v.:/src:Z dongheena/cpython_autoconf" - exit 2 -fi +BIN=/usr/local/bin +AUTOCONF=$BIN/autoconf +AUTORECONF=$BIN/autoreconf if [ "$#" = "0" ]; then - echo "Rebuilding configure script using $(autoconf --version | head -n 1)" - exec gosu autoreconf -ivf -Werror $@ + local SENTINEL=/src/pyconfig.h.in + + if [ ! -e ${SENTINEL} ]; then + echo "ERROR: ${SENTINEL} not found " + echo "Did you forget to mount Python work directory with '-v.:/src'?" + echo + echo " docker run -v\$PWD:/src ghcr.io/corona10/cpython_autoconf" + echo " podman run -v\$PWD:/src:Z ghcr.io/corona10/cpython_autoconf" + exit 2 + fi + + echo "Rebuilding configure script using $($AUTOCONF --version | head -n 1)" + exec gosu $AUTORECONF -ivf -Werror $@ fi -exec "$@" \ No newline at end of file +exec "$@"