Skip to content

Commit 8a044ce

Browse files
committed
Reverted Dockerfile to Swift-based images
1 parent d64be67 commit 8a044ce

1 file changed

Lines changed: 9 additions & 14 deletions

File tree

Dockerfile

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
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
108
COPY . /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" ]
2015
CMD ["."]

0 commit comments

Comments
 (0)