File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# syntax=docker/dockerfile:1
22
3- # Base image and static SDK have to be updated together.
4- FROM --platform=$BUILDPLATFORM swift:6.0.3 AS builder
5- WORKDIR /workspace
6- RUN swift sdk install \
7- https://download.swift.org/swift-6.0.3-release/static-sdk/swift-6.0.3-RELEASE/swift-6.0.3-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz \
8- --checksum 67f765e0030e661a7450f7e4877cfe008db4f57f177d5a08a6e26fd661cdd0bd
3+ # Swift official image with arm64 support
4+ # https://hub.docker.com/r/arm64v8/swift/
5+ ARG SWIFT_IMAGE=swift:focal
96
7+ FROM $SWIFT_IMAGE AS builder
108COPY . /workspace
11- ARG TARGETPLATFORM
12- RUN --mount=type=cache,target=/workspace/.build,id=build-$TARGETPLATFORM \
13- ./Scripts/build-linux-release.sh && \
14- cp /workspace/.build/release/swiftformat /workspace
9+ WORKDIR /workspace
10+ RUN swift build -c release && mv `swift build -c release --show-bin-path`/swiftformat /workspace
1511
16- # https://github.com/nicklockwood/SwiftFormat/issues/1930
17- FROM ubuntu:24.04 AS runner
18- COPY --from=builder /workspace/swiftformat /usr/bin/swiftformat
19- ENTRYPOINT [ "/usr/bin/swiftformat" ]
12+ FROM $SWIFT_IMAGE-slim AS runner
13+ COPY --from=builder /workspace/swiftformat /usr/bin
14+ ENTRYPOINT [ "swiftformat" ]
2015CMD ["." ]
You can’t perform that action at this time.
0 commit comments