Skip to content

Instantly share code, notes, and snippets.

@jjacobson93
Created February 8, 2018 00:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jjacobson93/34fc844188bcebfcab5274b69fd78253 to your computer and use it in GitHub Desktop.
Save jjacobson93/34fc844188bcebfcab5274b69fd78253 to your computer and use it in GitHub Desktop.
FROM swift:4
WORKDIR /build
COPY Sources ./Sources
COPY Package.swift .
RUN swift package resolve
RUN swift build
COPY pkg-swift-deps.sh /usr/bin/pkg-swift-deps
RUN pkg-swift-deps /build/.build/x86_64-unknown-linux/debug/swift-multistage-test
FROM busybox:glibc
COPY --from=0 /build/swift_libs.tar.gz /tmp/swift_libs.tar.gz
COPY --from=0 /build/.build/x86_64-unknown-linux/debug/swift-multistage-test /usr/bin/
RUN tar -xzvf /tmp/swift_libs.tar.gz && \
rm -rf /tmp/*
CMD ["swift-multistage-test"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment