Skip to content
This repository was archived by the owner on Oct 18, 2022. It is now read-only.

Use multi stage build to clear artifacts and reduce image size #90 #119

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
10 changes: 9 additions & 1 deletion update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ for v in "${versions[@]}"; do
)

cat > "$v/Dockerfile" <<EOF
FROM scratch
FROM scratch as builder
ADD $thisTar /
EOF

Expand Down Expand Up @@ -99,6 +99,14 @@ RUN sed -i 's/^#\s*\(deb.*universe\)$/\1/g' /etc/apt/sources.list
# See: https://github.com/systemd/systemd/blob/aa0c34279ee40bce2f9681b496922dedbadfca19/src/basic/virt.c#L434
RUN mkdir -p /run/systemd && echo 'docker' > /run/systemd/container

EOF

cat >> "$v/Dockerfile" <<'EOF'

FROM scratch

COPY --from=builder / /

# overwrite this with 'CMD []' in a dependent Dockerfile
CMD ["/bin/bash"]
EOF
Expand Down