forked from realm/SwiftLint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build additional Docker image with Swift 5.5 (realm#3904)
* Build additional Docker image with Swift 5.5 * Build `swiftlint_linux_swift_5_5.zip`
- Loading branch information
Showing
4 changed files
with
87 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Explicitly specify `focal` because `swift:latest` does not use `ubuntu:latest`. | ||
ARG BUILDER_IMAGE=swift:5.5-focal | ||
ARG RUNTIME_IMAGE=ubuntu:focal | ||
|
||
# builder image | ||
FROM ${BUILDER_IMAGE} AS builder | ||
RUN apt-get update && apt-get install -y \ | ||
libcurl4-openssl-dev \ | ||
libxml2-dev \ | ||
&& rm -r /var/lib/apt/lists/* | ||
WORKDIR /workdir/ | ||
COPY Source Source/ | ||
COPY Tests Tests/ | ||
COPY Package.* ./ | ||
|
||
RUN ln -s /usr/lib/swift/_InternalSwiftSyntaxParser . | ||
|
||
ARG SWIFT_FLAGS="-c release -Xswiftc -static-stdlib -Xlinker -lCFURLSessionInterface -Xlinker -lCFXMLInterface -Xlinker -lcurl -Xlinker -lxml2 -Xswiftc -I. -Xlinker -fuse-ld=lld -Xlinker -L/usr/lib/swift/linux" | ||
RUN swift build $SWIFT_FLAGS | ||
RUN mkdir -p /executables | ||
RUN for executable in $(swift package completion-tool list-executables); do \ | ||
install -v `swift build $SWIFT_FLAGS --show-bin-path`/$executable /executables; \ | ||
done | ||
|
||
# runtime image | ||
FROM ${RUNTIME_IMAGE} | ||
LABEL org.opencontainers.image.source https://github.com/realm/SwiftLint | ||
RUN apt-get update && apt-get install -y \ | ||
libcurl4 \ | ||
libxml2 \ | ||
&& rm -r /var/lib/apt/lists/* | ||
COPY --from=builder /usr/lib/libsourcekitdInProc.so /usr/lib | ||
COPY --from=builder /usr/lib/swift/linux/libBlocksRuntime.so /usr/lib | ||
COPY --from=builder /usr/lib/swift/linux/libdispatch.so /usr/lib | ||
COPY --from=builder /usr/lib/swift/linux/lib_InternalSwiftSyntaxParser.so /usr/lib | ||
COPY --from=builder /executables/* /usr/bin | ||
|
||
RUN swiftlint version | ||
|
||
CMD ["swiftlint"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters