Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
740 changes: 444 additions & 296 deletions .github/workflows/build.yaml

Large diffs are not rendered by default.

22 changes: 18 additions & 4 deletions ci/src/GithubJobBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ public function getJobsDescription(array $node): array
'name' => 'Export image (OCI layout)',
'if' => '${{ github.ref != \'refs/heads/master\' }}',
'uses' => 'docker/build-push-action@v6',
// Reuse the tested local build, including on no-cache reruns.
'with' => array_merge(
[
'context' => dirname(str_replace(__DIR__ . '/../../', '', $node['file'])),
'platforms' => '${{ matrix.platform }}',
'cache-from' => 'type=gha',
'cache-to' => 'type=gha,mode=max',
...$this->buildCacheWith($node),
'build-args' => implode("\n", [
'TARGETARCH=${{ matrix.arch }}',
]),
Expand All @@ -140,6 +140,8 @@ public function getJobsDescription(array $node): array
'name' => $this->getCiImageArtifactName($node['id']),
'path' => $this->getCiImagePath($node['id']),
'retention-days' => 1,
// A rerun must replace the previous attempt's parent image.
'overwrite' => true,
'compression-level' => 0,
'if-no-files-found' => 'error',
],
Expand Down Expand Up @@ -215,14 +217,26 @@ private function buildPushWith(array $node): array
'platforms' => '${{ matrix.platform }}',
'load' => true,
'tags' => 'ghcr.io/webdevops/' . $node['image'] . ':sha-${{ github.sha }}-${{ matrix.arch }}-' . $node['tag'],
'cache-from' => 'type=gha',
'cache-to' => 'type=gha,mode=max',
// Re-run all jobs to test a fresh build of the full image chain.
'no-cache' => '${{ github.event_name == \'schedule\' || github.run_attempt > 1 }}',
...$this->buildCacheWith($node),
'build-args' => implode("\n", [
'TARGETARCH=${{ matrix.arch }}',
]),
];
}

private function buildCacheWith(array $node): array
{
// Full image/tag and architecture keep scopes unique and reusable
// across commits, branches and reruns.
$cache = 'type=gha,scope=' . $node['id'] . '-${{ matrix.arch }}';
return [
'cache-from' => $cache,
'cache-to' => $cache . ',mode=max',
];
}

/**
* All internal webdevops/* images this node needs a same-run OCI
* artifact override for: its real FROM parent (if any) plus any images
Expand Down
4 changes: 2 additions & 2 deletions docker/php-official/8.2-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin
&& apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted \
# Install new version of ICU
&& curl -sS -o /tmp/icu.tar.gz -L https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz \
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && make install && cd / && rm -rf /tmp/icu* \
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make -j"$(nproc)" && make install && cd / && rm -rf /tmp/icu* \
# Install extensions
&& PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \
&& docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \
Expand All @@ -154,7 +154,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin
&& docker-php-ext-configure ldap \
&& docker-php-ext-configure ftp --with-openssl-dir \
&& PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
&& docker-php-ext-install \
&& docker-php-ext-install -j"$(nproc)" \
bcmath \
bz2 \
calendar \
Expand Down
4 changes: 2 additions & 2 deletions docker/php-official/8.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin
&& rm -rf master.zip guetzli-master \
# Install new version of ICU
&& curl -sS -o /tmp/icu.tar.gz -L https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz \
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && make install && cd / && rm -rf /tmp/icu* \
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make -j"$(nproc)" && make install && cd / && rm -rf /tmp/icu* \
# Install extensions
&& PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \
&& docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \
Expand All @@ -153,7 +153,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin
&& docker-php-ext-configure ldap \
&& docker-php-ext-configure ftp --with-openssl-dir \
&& PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
&& docker-php-ext-install \
&& docker-php-ext-install -j"$(nproc)" \
bcmath \
amqp \
imagick \
Expand Down
4 changes: 2 additions & 2 deletions docker/php-official/8.3-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin
&& apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted \
# Install new version of ICU
&& curl -sS -o /tmp/icu.tar.gz -L https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz \
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && make install && cd / && rm -rf /tmp/icu* \
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make -j"$(nproc)" && make install && cd / && rm -rf /tmp/icu* \
# Install extensions
&& PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \
&& docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \
Expand All @@ -154,7 +154,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin
&& docker-php-ext-configure ldap \
&& docker-php-ext-configure ftp --with-openssl-dir \
&& PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
&& docker-php-ext-install \
&& docker-php-ext-install -j"$(nproc)" \
bcmath \
bz2 \
calendar \
Expand Down
4 changes: 2 additions & 2 deletions docker/php-official/8.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin
&& rm -rf master.zip guetzli-master \
# Install new version of ICU
&& curl -sS -o /tmp/icu.tar.gz -L https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz \
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && make install && cd / && rm -rf /tmp/icu* \
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make -j"$(nproc)" && make install && cd / && rm -rf /tmp/icu* \
# Install extensions
&& PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \
&& docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \
Expand All @@ -153,7 +153,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin
&& docker-php-ext-configure ldap \
&& docker-php-ext-configure ftp --with-openssl-dir \
&& PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
&& docker-php-ext-install \
&& docker-php-ext-install -j"$(nproc)" \
bcmath \
amqp \
imagick \
Expand Down
4 changes: 2 additions & 2 deletions docker/php-official/8.4-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin
&& apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted \
# Install new version of ICU
&& curl -sS -o /tmp/icu.tar.gz -L https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz \
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && make install && cd / && rm -rf /tmp/icu* \
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make -j"$(nproc)" && make install && cd / && rm -rf /tmp/icu* \
# Install extensions
&& PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \
&& docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \
Expand All @@ -153,7 +153,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin
&& cd /usr/src/php/ext/amqp && git submodule update --init \
&& docker-php-ext-configure ldap \
&& docker-php-ext-configure ftp --with-ftp-ssl \
&& docker-php-ext-install \
&& docker-php-ext-install -j"$(nproc)" \
bcmath \
bz2 \
calendar \
Expand Down
4 changes: 2 additions & 2 deletions docker/php-official/8.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin
&& rm -rf master.zip guetzli-master \
# Install new version of ICU
&& curl -sS -o /tmp/icu.tar.gz -L https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz \
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && make install && cd / && rm -rf /tmp/icu* \
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make -j"$(nproc)" && make install && cd / && rm -rf /tmp/icu* \
# Install extensions
&& PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \
&& docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \
Expand All @@ -151,7 +151,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin
&& git clone --branch master --depth 1 https://github.com/Imagick/imagick.git /usr/src/php/ext/imagick \
&& docker-php-ext-configure ldap \
&& docker-php-ext-configure ftp --with-ftp-ssl \
&& docker-php-ext-install \
&& docker-php-ext-install -j"$(nproc)" \
bcmath \
amqp \
imagick \
Expand Down
4 changes: 2 additions & 2 deletions docker/php-official/8.5-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin
&& apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted \
# Install new version of ICU
&& curl -sS -o /tmp/icu.tar.gz -L https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz \
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && make install && cd / && rm -rf /tmp/icu* \
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make -j"$(nproc)" && make install && cd / && rm -rf /tmp/icu* \
# Install extensions
&& PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \
&& docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \
Expand All @@ -153,7 +153,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin
&& cd /usr/src/php/ext/amqp && git submodule update --init \
&& docker-php-ext-configure ldap \
&& docker-php-ext-configure ftp --with-ftp-ssl \
&& docker-php-ext-install \
&& docker-php-ext-install -j"$(nproc)" \
bcmath \
bz2 \
calendar \
Expand Down
4 changes: 2 additions & 2 deletions docker/php-official/8.5/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin
&& rm -rf master.zip guetzli-master \
# Install new version of ICU
&& curl -sS -o /tmp/icu.tar.gz -L https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz \
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && make install && cd / && rm -rf /tmp/icu* \
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make -j"$(nproc)" && make install && cd / && rm -rf /tmp/icu* \
# Install extensions
&& PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \
&& docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \
Expand All @@ -151,7 +151,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin
&& git clone --branch master --depth 1 https://github.com/Imagick/imagick.git /usr/src/php/ext/imagick \
&& docker-php-ext-configure ldap \
&& docker-php-ext-configure ftp --with-ftp-ssl \
&& docker-php-ext-install \
&& docker-php-ext-install -j"$(nproc)" \
bcmath \
amqp \
imagick \
Expand Down
8 changes: 4 additions & 4 deletions template/Dockerfile/images/php.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
&& rm -rf master.zip guetzli-master \
# Install new version of ICU
&& curl -sS -o /tmp/icu.tar.gz -L https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz \
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && make install && cd / && rm -rf /tmp/icu* \
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make -j"$(nproc)" && make install && cd / && rm -rf /tmp/icu* \
# Install extensions
&& PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \
&& docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \
Expand All @@ -123,7 +123,7 @@
{%- if version != '8.4' and version != '8.5' %}
&& PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
{%- endif %}
&& docker-php-ext-install \
&& docker-php-ext-install -j"$(nproc)" \
bcmath \
amqp \
imagick \
Expand Down Expand Up @@ -261,7 +261,7 @@
&& apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted \
# Install new version of ICU
&& curl -sS -o /tmp/icu.tar.gz -L https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz \
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && make install && cd / && rm -rf /tmp/icu* \
&& tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make -j"$(nproc)" && make install && cd / && rm -rf /tmp/icu* \
# Install extensions
&& PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \
&& docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \
Expand All @@ -277,7 +277,7 @@
{%- if version != '8.4' and version != '8.5' %}
&& PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
{%- endif %}
&& docker-php-ext-install \
&& docker-php-ext-install -j"$(nproc)" \
bcmath \
bz2 \
calendar \
Expand Down
Loading