Skip to content

Commit

Permalink
Add PHP 8.3
Browse files Browse the repository at this point in the history
Downgrade i386 to bullseye
  • Loading branch information
shivammathur committed Aug 10, 2023
1 parent 0debac2 commit 8e5fed1
Show file tree
Hide file tree
Showing 7 changed files with 194 additions and 15 deletions.
12 changes: 9 additions & 3 deletions .github/scripts/get-matrix.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
platforms=(linux/386 linux/amd64 linux/arm/v7 linux/arm64 multi)
tags=('latest' 'bookworm,12' 'jammy,2204' 'focal,2004' 'latest-slim' 'bookworm-slim,12-slim' 'jammy-slim,2204-slim' 'focal-slim,2004-slim')
tags=('latest' 'bookworm,12' 'bullseye,11' 'jammy,2204' 'focal,2004' 'latest-slim' 'bookworm-slim,12-slim' 'bullseye-slim,11-slim' 'jammy-slim,2204-slim' 'focal-slim,2004-slim')
matrix=()
for platform in "${platforms[@]}"; do
for tag in "${tags[@]}"; do
if [[ "$tag" =~ latest ]]; then
if [ "$platform" = "linux/386" ]; then
base="debian:12"
file="bookworm"
base="debian:11"
file="bullseye"
else
base="ubuntu:22.04"
file="jammy"
Expand All @@ -24,8 +24,14 @@ for platform in "${platforms[@]}"; do
base="ubuntu:20.04"
file="focal"
elif [[ "$tag" =~ bookworm ]]; then
if [ "$platform" = "linux/386" ]; then
continue
fi
base="debian:12"
file="bookworm"
elif [[ "$tag" =~ bullseye ]]; then
base="debian:11"
file="bullseye"
fi
if [[ "$tag" =~ slim ]]; then
build_args="type=slim"
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/prep-environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ orgptags=$(echo "$TAGS" | awk -v platform="$platform" 'BEGIN{FS=OFS=","} NR==1{f
key=$(echo -n "$tags $ptags" | openssl dgst -sha256 | cut -d ' ' -f 2)

multi='linux/amd64,linux/arm/v7,linux/arm64'
[ "${FILE:?}" = "bookworm" ] && multi="linux/386,$multi"
[ "${FILE:?}" = "bullseye" ] && multi="linux/386,$multi"

(
echo "tags=${tags},${orgtags}";
Expand Down
15 changes: 11 additions & 4 deletions Dockerfile_bookworm
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ RUN set -ex \
# smoke test
&& yarn --version

RUN if [ "$type" = "full" ]; then DOCKER_PACKAGES= && set -ex \
RUN if [ "$type" = "full" ]; then set -ex \
&& savedAptMark="$(apt-mark showmanual)" \
&& apt-mark auto '.*' > /dev/null \
&& apt-get update && apt-get install -y --no-install-recommends curl gnupg jq lsb-release mariadb-server postgresql unzip \
Expand All @@ -89,7 +89,7 @@ RUN if [ "$type" = "full" ]; then DOCKER_PACKAGES= && set -ex \
&& echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
&& apt-get update \
&& cp -r /etc/apt/sources.list.d /etc/apt/sources.list.d.save \
&& for v in 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2; do \
&& for v in 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3; do \
apt-get install -y --no-install-recommends php"$v" \
php"$v"-dev \
php"$v"-curl \
Expand All @@ -98,7 +98,6 @@ RUN if [ "$type" = "full" ]; then DOCKER_PACKAGES= && set -ex \
php"$v"-intl \
php"$v"-mysql \
php"$v"-pgsql \
php"$v"-xdebug \
php"$v"-zip; \
done \
&& curl -o /usr/bin/systemctl -sL https://raw.githubusercontent.com/shivammathur/node-docker/main/systemctl-shim \
Expand All @@ -107,7 +106,14 @@ RUN if [ "$type" = "full" ]; then DOCKER_PACKAGES= && set -ex \
&& curl -o /tmp/pear.phar -sL https://raw.githubusercontent.com/pear/pearweb_phars/master/install-pear-nozlib.phar \
&& php /tmp/pear.phar && sudo rm -f /tmp/pear.phar \
&& apt-get install -y --no-install-recommends autoconf automake gcc g++ git \
&& [ "$(dpkg --print-architecture)" = "i386" ] && apt-get install -y --no-install-recommends docker.io || apt-get install -y --no-install-recommends docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin \
&& apt-get install -y --no-install-recommends docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin \
&& for v in 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3; do \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends php"$v"-xdebug 2>/dev/null \
|| (spc -p "$v" -e xdebug-xdebug/xdebug@master -r verbose) \
done \
&& for tool in php phar phar.phar php-cgi php-config phpize phpdbg; do \
{ [ -e /usr/bin/"$tool"8.2 ] && sudo update-alternatives --set $tool /usr/bin/"$tool"8.2 || true; } \
done \
&& rm -rf /var/lib/apt/lists/* \
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; } \
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
Expand All @@ -132,6 +138,7 @@ RUN if [ "$type" = "full" ]; then DOCKER_PACKAGES= && set -ex \
&& php8.0 -v \
&& php8.1 -v \
&& php8.2 -v \
&& php8.3 -v \
&& php -v; \
fi

Expand Down
145 changes: 145 additions & 0 deletions Dockerfile_bullseye
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
FROM debian:bullseye
ARG type
ENV CONTAINER shivammathur/node
ENV DEBIAN_FRONTEND=noninteractive
ENV NODE_VERSION 16.20.2
ENV NODE_VERSION_x86 16.20.2
ENV YARN_VERSION 1.22.19
ENV RUNNER_TOOL_PATH "/opt/hostedtoolcache"
ENV RUNNER_TOOL_CACHE "/opt/hostedtoolcache"
ENV GITHUB_ENV "/tmp/set_env"
ENV GITHUB_PATH "/tmp/add_path"
ENV runner "self-hosted"

RUN ARCH= && MULTILIB= && PREFIX='www' && URLPATH='dist' && dpkgArch="$(dpkg --print-architecture)" \
&& case "${dpkgArch##*-}" in \
amd64) ARCH='x64';; \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
i386) ARCH='x86'; MULTILIB='gcc-multilib'; PREFIX='unofficial-builds'; URLPATH='download/release'; NODE_VERSION=$NODE_VERSION_x86;; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& set -ex \
&& echo "" | tee "$GITHUB_ENV" "$GITHUB_PATH" \
&& mkdir -p "$RUNNER_TOOL_CACHE" \
# libatomic1 for arm
&& apt-get update && apt-get install -y ca-certificates curl wget gnupg dirmngr xz-utils libatomic1 $MULTILIB --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& curl -fsSLO --compressed "https://$PREFIX.nodejs.org/$URLPATH/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
&& curl -o /usr/local/bin/spc -sL https://github.com/shivammathur/spc/releases/latest/download/spc \
&& curl -o /usr/local/bin/systemctl -sL https://raw.githubusercontent.com/shivammathur/node-docker/main/systemctl-shim \
&& chmod a+x /usr/local/bin/spc /usr/local/bin/systemctl \
&& apt-mark auto '.*' > /dev/null \
&& apt-mark manual curl libatomic1 $MULTILIB \
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
| awk '/=>/ { print $(NF-1) }' \
| sort -u \
| xargs -r dpkg-query --search \
| cut -d: -f1 \
| sort -u \
| xargs -r apt-mark manual \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
# smoke tests
&& node --version \
&& npm --version \
&& spc -V

RUN set -ex \
&& savedAptMark="$(apt-mark showmanual)" \
&& apt-get update && apt-get install -y ca-certificates curl wget gnupg dirmngr make sudo --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& curl -fsSLO --compressed "https://github.com/yarnpkg/yarn/releases/download/v$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
&& mkdir -p /opt /opt/hostedtoolcache \
&& chmod -R 777 /opt/hostedtoolcache \
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \
&& rm yarn-v$YARN_VERSION.tar.gz \
&& apt-mark auto '.*' > /dev/null \
&& apt-mark manual ca-certificates sudo make \
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; } \
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
| awk '/=>/ { print $(NF-1) }' \
| sort -u \
| xargs -r dpkg-query --search \
| cut -d: -f1 \
| sort -u \
| xargs -r apt-mark manual \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
# smoke test
&& yarn --version

RUN if [ "$type" = "full" ]; then DOCKER_PACKAGES= && set -ex \
&& savedAptMark="$(apt-mark showmanual)" \
&& apt-mark auto '.*' > /dev/null \
&& apt-get update && apt-get install -y --no-install-recommends curl gnupg jq lsb-release mariadb-server postgresql unzip \
&& usermod -d /var/lib/mysql/ mysql \
&& curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg \
&& curl -sSLo /usr/share/keyrings/deb.sury.org-apache2.gpg https://packages.sury.org/apache2/apt.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ bullseye main" > /etc/apt/sources.list.d/php.list \
&& echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-apache2.gpg] https://packages.sury.org/apache2/ bullseye main" > /etc/apt/sources.list.d/apache2.list \
&& install -m 0755 -d /etc/apt/keyrings \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
&& chmod a+r /etc/apt/keyrings/docker.gpg \
&& echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian bullseye stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
&& apt-get update \
&& cp -r /etc/apt/sources.list.d /etc/apt/sources.list.d.save \
&& for v in 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3; do \
apt-get install -y --no-install-recommends php"$v" \
php"$v"-dev \
php"$v"-curl \
php"$v"-mbstring \
php"$v"-xml \
php"$v"-intl \
php"$v"-mysql \
php"$v"-pgsql \
php"$v"-zip; \
done \
&& curl -o /usr/bin/systemctl -sL https://raw.githubusercontent.com/shivammathur/node-docker/main/systemctl-shim \
&& chmod a+x /usr/bin/systemctl \
&& curl -o /usr/lib/ssl/cert.pem -sL https://curl.se/ca/cacert.pem \
&& curl -o /tmp/pear.phar -sL https://raw.githubusercontent.com/pear/pearweb_phars/master/install-pear-nozlib.phar \
&& php /tmp/pear.phar && sudo rm -f /tmp/pear.phar \
&& apt-get install -y --no-install-recommends autoconf automake gcc g++ git \
&& [ "$(dpkg --print-architecture)" = "i386" ] && apt-get install -y --no-install-recommends docker.io || apt-get install -y --no-install-recommends docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin \
&& for v in 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3; do \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends php"$v"-xdebug 2>/dev/null \
|| (spc -p "$v" -e xdebug-xdebug/xdebug@master -r verbose) \
done \
&& for tool in php phar phar.phar php-cgi php-config phpize phpdbg; do \
{ [ -e /usr/bin/"$tool"8.2 ] && sudo update-alternatives --set $tool /usr/bin/"$tool"8.2 || true; } \
done \
&& rm -rf /var/lib/apt/lists/* \
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; } \
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
| awk '/=>/ { print $(NF-1) }' \
| sort -u \
| xargs -r dpkg-query --search \
| cut -d: -f1 \
| sort -u \
| xargs -r apt-mark manual \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
# smoke test
&& gcc --version \
&& g++ --version \
&& git --version \
&& docker --version \
&& php5.6 -v \
&& php7.0 -v \
&& php7.1 -v \
&& php7.2 -v \
&& php7.3 -v \
&& php7.4 -v \
&& php8.0 -v \
&& php8.1 -v \
&& php8.2 -v \
&& php8.3 -v \
&& php -v; \
fi

CMD [ "/bin/bash" ]
11 changes: 9 additions & 2 deletions Dockerfile_focal
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ RUN if [ "$type" = "full" ]; then set -ex \
&& apt-get remove software-properties-common -y \
&& apt-get update \
&& cp -r /etc/apt/sources.list.d /etc/apt/sources.list.d.save \
&& for v in 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2; do \
&& for v in 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3; do \
apt-get install -y --no-install-recommends php"$v" \
php"$v"-dev \
php"$v"-curl \
Expand All @@ -98,7 +98,6 @@ RUN if [ "$type" = "full" ]; then set -ex \
php"$v"-intl \
php"$v"-mysql \
php"$v"-pgsql \
php"$v"-xdebug \
php"$v"-zip; \
done \
&& curl -o /usr/bin/systemctl -sL https://raw.githubusercontent.com/shivammathur/node-docker/main/systemctl-shim \
Expand All @@ -108,6 +107,13 @@ RUN if [ "$type" = "full" ]; then set -ex \
&& php /tmp/pear.phar && sudo rm -f /tmp/pear.phar \
&& apt-get install -y --no-install-recommends autoconf automake gcc g++ git \
&& apt-get install -y --no-install-recommends docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin \
&& for v in 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3; do \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends php"$v"-xdebug 2>/dev/null \
|| (spc -p "$v" -e xdebug-xdebug/xdebug@master -r verbose) \
done \
&& for tool in php phar phar.phar php-cgi php-config phpize phpdbg; do \
{ [ -e /usr/bin/"$tool"8.2 ] && sudo update-alternatives --set $tool /usr/bin/"$tool"8.2 || true; } \
done \
&& rm -rf /var/lib/apt/lists/* \
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; } \
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
Expand All @@ -132,6 +138,7 @@ RUN if [ "$type" = "full" ]; then set -ex \
&& php8.0 -v \
&& php8.1 -v \
&& php8.2 -v \
&& php8.3 -v \
&& php -v; \
fi

Expand Down
11 changes: 9 additions & 2 deletions Dockerfile_jammy
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ RUN if [ "$type" = "full" ]; then set -ex \
&& echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
&& apt-get update \
&& cp -r /etc/apt/sources.list.d /etc/apt/sources.list.d.save \
&& for v in 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2; do \
&& for v in 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3; do \
apt-get install -y --no-install-recommends php"$v" \
php"$v"-dev \
php"$v"-curl \
Expand All @@ -98,7 +98,6 @@ RUN if [ "$type" = "full" ]; then set -ex \
php"$v"-intl \
php"$v"-mysql \
php"$v"-pgsql \
php"$v"-xdebug \
php"$v"-zip; \
done \
&& curl -o /usr/bin/systemctl -sL https://raw.githubusercontent.com/shivammathur/node-docker/main/systemctl-shim \
Expand All @@ -108,6 +107,13 @@ RUN if [ "$type" = "full" ]; then set -ex \
&& php /tmp/pear.phar && sudo rm -f /tmp/pear.phar \
&& apt-get install -y --no-install-recommends autoconf automake gcc g++ git \
&& apt-get install -y --no-install-recommends docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin \
&& for v in 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3; do \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends php"$v"-xdebug 2>/dev/null \
|| (spc -p "$v" -e xdebug-xdebug/xdebug@master -r verbose) \
done \
&& for tool in php phar phar.phar php-cgi php-config phpize phpdbg; do \
{ [ -e /usr/bin/"$tool"8.2 ] && sudo update-alternatives --set $tool /usr/bin/"$tool"8.2 || true; } \
done \
&& rm -rf /var/lib/apt/lists/* \
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; } \
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
Expand All @@ -132,6 +138,7 @@ RUN if [ "$type" = "full" ]; then set -ex \
&& php8.0 -v \
&& php8.1 -v \
&& php8.2 -v \
&& php8.3 -v \
&& php -v; \
fi

Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Docker images to run setup-php GitHub Action.

### `latest`

- Ubuntu 22.04 (jammy), Debian 12 (bookworm) on i386
- Ubuntu 22.04 (jammy), Debian 11 (bullseye) on i386
- PHP 5.6 to PHP 8.2
- Node.js 16.20.2
- Yarn 1.22.19
Expand All @@ -34,6 +34,13 @@ Docker images to run setup-php GitHub Action.
- Node.js 16.20.2
- Yarn 1.22.19

### `bullseye`, `11`

- Debian 11 (bullseye)
- PHP 5.6 to PHP 8.2
- Node.js 16.20.2
- Yarn 1.22.19

### `jammy`, `2204`

- Ubuntu 22.04 (jammy)
Expand Down Expand Up @@ -71,8 +78,8 @@ Docker images to run setup-php GitHub Action.
- Suffix `amd64`, `i386`, `arm32v7` `arm64v8` to above image variants to get image for specific OS architecture.
For example `shivammathur/node:focal-arm64v8`, `setupphp/node:focal-arm64v8`

- `i386` is only available for Debian 12 (bookworm).
- `i386` latest and latest-slim images are based on Debian 12 (bookworm).
- `i386` is only available for Debian 11 (bullseye).
- `i386` latest and latest-slim images are based on Debian 11 (bullseye).

## License

Expand Down

0 comments on commit 8e5fed1

Please sign in to comment.