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

Support reproducible builds (except packages) #915

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
20 changes: 15 additions & 5 deletions Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
-}}
FROM php:{{ env.phpVersion }}-{{ env.variant }}

# The global SOURCE_DATE_EPOCH is consumed by commands that are not associated with a source artifact.
# This is not propagated from --build-arg: https://github.com/moby/buildkit/issues/4576#issuecomment-2159501282
ENV SOURCE_DATE_EPOCH 0

{{ if env.version != "cli" then ( -}}
# persistent dependencies
{{ if is_alpine then ( -}}
Expand All @@ -15,15 +19,19 @@ RUN set -eux; \
ghostscript \
# Alpine package for "imagemagick" contains ~120 .so files, see: https://github.com/docker-library/wordpress/pull/497
imagemagick \
;
; \
# clean up for reproducibility
rm -rf /var/cache/fontconfig
{{ ) else ( -}}
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
# Ghostscript is required for rendering PDF previews
ghostscript \
; \
rm -rf /var/lib/apt/lists/*
rm -rf /var/lib/apt/lists/* ; \
# clean up for reproducibility
rm -rf /var/log/* /var/cache/ldconfig/aux-cache
{{ ) end -}}
{{ ) else ( -}}
# install wp-cli dependencies
Expand All @@ -43,7 +51,7 @@ WORKDIR /var/www/html
RUN set -ex; \
\
{{ if is_alpine then ( -}}
apk add --no-cache --virtual .build-deps \
apk add --no-cache --virtual .build-deps=0 \
$PHPIZE_DEPS \
freetype-dev \
icu-dev \
Expand Down Expand Up @@ -123,7 +131,7 @@ RUN set -ex; \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --no-network --virtual .wordpress-phpexts-rundeps $runDeps; \
apk add --no-network --virtual .wordpress-phpexts-rundeps=0 $runDeps; \
apk del --no-network .build-deps; \
{{ ) else ( -}}
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
Expand All @@ -139,6 +147,8 @@ RUN set -ex; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*; \
# clean up for reproducibility
rm -rf /var/log/* /var/cache/ldconfig/aux-cache; \
{{ ) end -}}
\
! { ldd "$extDir"/*.so | grep 'not found'; }; \
Expand Down Expand Up @@ -247,7 +257,7 @@ ENV WORDPRESS_CLI_SHA512 {{ .sha512 }}

RUN set -ex; \
\
apk add --no-cache --virtual .fetch-deps \
apk add --no-cache --virtual .fetch-deps=0 \
gnupg \
; \
\
Expand Down
10 changes: 9 additions & 1 deletion beta/php8.1/apache/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions beta/php8.1/fpm-alpine/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion beta/php8.1/fpm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion beta/php8.2/apache/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions beta/php8.2/fpm-alpine/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion beta/php8.2/fpm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion beta/php8.3/apache/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions beta/php8.3/fpm-alpine/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion beta/php8.3/fpm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading