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

Suggestions #9

Merged
merged 1 commit into from Mar 1, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 10 additions & 6 deletions Dockerfile
Expand Up @@ -6,15 +6,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."

RUN apk upgrade
RUN apk add autoconf automake autoconf-archive libtool pkgconfig alpine-sdk
RUN wget https://ftp.gnu.org/gnu/autoconf/autoconf-2.72.tar.gz
RUN tar -zxvf autoconf-2.72.tar.gz
RUN apk upgrade && \
apk add \
alpine-sdk \
autoconf \
automake \
autoconf-archive \
libtool \
pkgconfig
Comment on lines +9 to +16
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See https://docs.docker.com/develop/develop-images/instructions/#apt-get

Why is pkgconfig and alpine-sdk required? Is it because we build GNU Autoconf from scratch later?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes :)

RUN curl https://ftp.gnu.org/gnu/autoconf/autoconf-2.72.tar.gz | tar -zxvf -
RUN cd autoconf-2.72 && ./configure && make && make install
RUN autoconf -V | grep -q "autoconf (GNU Autoconf) 2.72"

VOLUME /src
WORKDIR /src

ADD entry.sh /
CMD ["/entry.sh"]
CMD ["/entry.sh"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooops, this was unintentional (I blame the GitHub UI editor)

17 changes: 11 additions & 6 deletions README.md
@@ -1,17 +1,22 @@
# cpython_autoconf
- Container image with autotools to regenerate Python's configure script.
# CPython Autoconf

- Container image with GNU Autotools to regenerate CPython's `configure` script.
- Fork from https://github.com/tiran/cpython_autoconf

## Fedora, CentOS and other SELinux-enabled systems with podman

```shell
$ cd cpython
$ podman run --rm --pull=always -v$(pwd):/src:Z ghcr.io/corona10/cpython_autoconf:271
$ podman run --rm --pull=always -v$(pwd):/src:Z ghcr.io/corona10/cpython_autoconf:272
```

## Arch, Debian, Gentoo, Ubuntu

```shell
$ cd cpython
$ podman run --rm --pull=always -v$(pwd):/src ghcr.io/corona10/cpython_autoconf:271
$ podman run --rm --pull=always -v$(pwd):/src ghcr.io/corona10/cpython_autoconf:272
```

## macOS and Windows

```shell
$ docker run --rm --pull=always -v.:/src ghcr.io/corona10/cpython_autoconf:272
```
10 changes: 6 additions & 4 deletions entry.sh
Expand Up @@ -13,7 +13,9 @@ if [ ! -e ${SENTINEL} ]; then
exit 2
fi

echo "Rebuilding configure script"
cd $SRC
autoreconf -ivf -Werror $@
echo "Done"
if [ "$#" = "0" ]; then
echo "Rebuilding configure script using $(autoconf --version | head -n 1)"
exec gosu autoreconf -ivf -Werror $@
fi

exec "$@"
Comment on lines +16 to +21
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it can be nice to be able to run with arbitrary commands. For example:

$ docker run --rm -v$PWD:/src ghcr.io/corona10/cpython_autoconf:272-final autoconf --version

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, gosu is perhaps overkill, but you never know. We may have to install it explicitly, though.