Skip to content

Commit

Permalink
Use busybox for runner base (#1934)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyberbeni authored Nov 26, 2024
1 parent eb55d16 commit 8d3db33
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
# syntax=docker/dockerfile:1

# Base image and static SDK have to be updated together.
FROM --platform=$BUILDPLATFORM swift:6.0.1 AS builder
FROM --platform=$BUILDPLATFORM swift:6.0.2 AS builder
WORKDIR /workspace
RUN swift sdk install \
https://download.swift.org/swift-6.0.1-release/static-sdk/swift-6.0.1-RELEASE/swift-6.0.1-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz \
--checksum d4f46ba40e11e697387468e18987ee622908bc350310d8af54eb5e17c2ff5481
https://download.swift.org/swift-6.0.2-release/static-sdk/swift-6.0.2-RELEASE/swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz \
--checksum aa5515476a403797223fc2aad4ca0c3bf83995d5427fb297cab1d93c68cee075

COPY . /workspace
ARG TARGETPLATFORM
RUN --mount=type=cache,target=/workspace/.build,id=build-$TARGETPLATFORM \
./Scripts/build-linux-release.sh && \
cp /workspace/.build/release/swiftformat /workspace

FROM scratch AS runner
# /~https://github.com/nicklockwood/SwiftFormat/issues/1930
FROM busybox:stable AS runner
COPY --from=builder /workspace/swiftformat /usr/bin/swiftformat
ENTRYPOINT [ "/usr/bin/swiftformat" ]
CMD ["."]

0 comments on commit 8d3db33

Please sign in to comment.