-
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.
- Loading branch information
Showing
3 changed files
with
62 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
ARG BUILDER_IMAGE=swift:5.9-jammy | ||
ARG RUNTIME_IMAGE=ubuntu:jammy | ||
|
||
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 Sources Sources/ | ||
COPY Tests Tests/ | ||
COPY Package.* ./ | ||
|
||
RUN swift package resolve | ||
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 --product github-apps-token | ||
RUN mv `swift build $SWIFT_FLAGS --show-bin-path`/github-apps-token /usr/bin | ||
|
||
# Runtime image | ||
FROM ${RUNTIME_IMAGE} | ||
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/host/libSwiftBasicFormat.so /usr/lib | ||
COPY --from=builder /usr/lib/swift/host/libSwiftCompilerPluginMessageHandling.so /usr/lib | ||
COPY --from=builder /usr/lib/swift/host/libSwiftDiagnostics.so /usr/lib | ||
COPY --from=builder /usr/lib/swift/host/libSwiftOperators.so /usr/lib | ||
COPY --from=builder /usr/lib/swift/host/libSwiftParser.so /usr/lib | ||
COPY --from=builder /usr/lib/swift/host/libSwiftParserDiagnostics.so /usr/lib | ||
COPY --from=builder /usr/lib/swift/host/libSwiftSyntax.so /usr/lib | ||
COPY --from=builder /usr/lib/swift/host/libSwiftSyntaxBuilder.so /usr/lib | ||
COPY --from=builder /usr/lib/swift/host/libSwiftSyntaxMacroExpansion.so /usr/lib | ||
COPY --from=builder /usr/lib/swift/host/libSwiftSyntaxMacros.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/libswift_Concurrency.so /usr/lib | ||
COPY --from=builder /usr/lib/swift/linux/libswift_RegexParser.so /usr/lib | ||
COPY --from=builder /usr/lib/swift/linux/libswift_StringProcessing.so /usr/lib | ||
COPY --from=builder /usr/lib/swift/linux/libswiftCore.so /usr/lib | ||
COPY --from=builder /usr/lib/swift/linux/libswiftGlibc.so /usr/lib | ||
COPY --from=builder /usr/bin/github-apps-token /usr/bin | ||
|
||
RUN github-apps-token --version | ||
|
||
CMD ["github-apps-token"] |
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