Skip to content
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

Updates #1

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 11 additions & 4 deletions .github/workflows/ci.yml
Expand Up @@ -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
Expand All @@ -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 }}
32 changes: 25 additions & 7 deletions 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
Expand Down
31 changes: 17 additions & 14 deletions 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 "$@"
exec "$@"