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

refactor(dev-tools): reduce image size #983

Closed
wants to merge 1 commit into from
Closed
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
18 changes: 14 additions & 4 deletions dev-tools/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
FROM ghcr.io/automattic/vip-container-images/alpine:3.20.3@sha256:42ee5e50414b7c636fa5ee8b0d1c6b0219bb413285e4110178b16416711f52c9
FROM alpine:3.20.3@sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a AS build

COPY setup.sh add-site.sh dev-env-plugin.php wp-config* /dev-tools/
COPY scripts /scripts
ENV SOURCE_DATE_EPOCH=0

CMD ["sleep", "infinity"]
RUN \
apk add --no-cache gcc musl-dev && \
mkdir -p /target/bin && \
echo 'int main() { return 0; }' > /true.c && \
gcc -o /target/bin/true /true.c -Os -s -static

COPY setup.sh add-site.sh dev-env-plugin.php wp-config* /target/dev-tools/
COPY scripts /target/scripts

FROM scratch
COPY --from=build /target /
CMD ["/bin/true"]
Loading