Skip to content

Commit f64f719

Browse files
committed
cpython-devcontainers: Set up init files
0 parents  commit f64f719

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

autoconf/Dockerfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FROM docker.io/library/alpine:3.19
2+
3+
ARG AUTOCONF_VERSION="2.71"
4+
ARG AUTOCONF_ARCHIVE_VERSION="2023.02.20"
5+
ARG AUTOMAKE_VERSION="1.16.5"
6+
7+
LABEL org.opencontainers.image.source="https://github.com/python/cpython-devcontainers"
8+
LABEL org.opencontainers.image.base.name="docker.io/library/alpine:3.19"
9+
LABEL org.opencontainers.image.authors="Donghee Na"
10+
LABEL org.opencontainers.image.title="GNU Autoconf ${AUTOCONF_VERSION} container for CPython"
11+
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."
12+
13+
RUN apk upgrade && \
14+
apk add \
15+
alpine-sdk \
16+
autoconf \
17+
automake \
18+
xz
19+
RUN set -o pipefail \
20+
&& curl https://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.gz | tar -zxf - \
21+
&& cd autoconf-${AUTOCONF_VERSION} \
22+
&& ./configure --prefix=/usr/local \
23+
&& make \
24+
&& make install
25+
RUN set -o pipefail \
26+
&& curl https://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.gz | tar -xzf - \
27+
&& cd automake-${AUTOMAKE_VERSION} \
28+
&& ./configure --prefix=/usr/local \
29+
&& make \
30+
&& make install
31+
RUN set -o pipefail \
32+
&& curl https://ftp.gnu.org/gnu/autoconf-archive/autoconf-archive-${AUTOCONF_ARCHIVE_VERSION}.tar.xz | xz -cd - | tar -xf - \
33+
&& cd autoconf-archive-${AUTOCONF_ARCHIVE_VERSION} \
34+
&& ./configure --prefix=/usr/local \
35+
&& make \
36+
&& make install
37+
38+
VOLUME /src
39+
WORKDIR /src
40+
41+
ADD entry.sh /
42+
CMD ["/entry.sh"]

autoconf/entry.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/sh
2+
set -e
3+
4+
BIN=/usr/local/bin
5+
AUTOCONF=$BIN/autoconf
6+
AUTORECONF=$BIN/autoreconf
7+
8+
if [ "$#" = "0" ]; then
9+
SENTINEL=/src/pyconfig.h.in
10+
11+
if [ ! -e ${SENTINEL} ]; then
12+
echo "ERROR: ${SENTINEL} not found "
13+
echo "Did you forget to mount Python work directory with '-v.:/src'?"
14+
echo
15+
echo " docker run -v\$PWD:/src ghcr.io/python/cpython-autoconf"
16+
echo " podman run -v\$PWD:/src:Z ghcr.io/python/cpython-autoconf"
17+
exit 2
18+
fi
19+
20+
echo "Rebuilding configure script using $($AUTOCONF --version | head -n 1)"
21+
exec $AUTORECONF -ivf -Werror $@
22+
fi
23+
24+
exec "$@"
25+

0 commit comments

Comments
 (0)