forked from craigwrong/swift-bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Corrected multi platform issues #287
- Loading branch information
1 parent
e300ae3
commit 107fdf3
Showing
3 changed files
with
16 additions
and
11 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 |
---|---|---|
@@ -1,17 +1,20 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
FROM swift:6.0.2 AS builder | ||
FROM --platform=$BUILDPLATFORM swift:6.0.2 AS builder | ||
ARG TARGETARCH | ||
COPY . /opt/swift-bitcoin | ||
WORKDIR /opt/swift-bitcoin | ||
RUN \ | ||
swift sdk install https://download.swift.org/swift-6.0.2-release/static-sdk/swift-6.0.2-RELEASE/swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz --checksum aa5515476a403797223fc2aad4ca0c3bf83995d5427fb297cab1d93c68cee075 && \ | ||
swift build -c release --swift-sdk aarch64-swift-linux-musl | ||
if [ $TARGETARCH = arm64 ]; then export ARCH=aarch64; elif [ $TARGETARCH = amd64 ]; then export ARCH=x86_64; else export ARCH=$TARGETARCH; fi && \ | ||
swift build -c release --swift-sdk $ARCH-swift-linux-musl && \ | ||
mv /opt/swift-bitcoin/.build/$ARCH-swift-linux-musl /opt/swift-bitcoin/.build/swift-linux-musl | ||
# && \ swift test | ||
|
||
FROM scratch AS bcutil | ||
COPY --from=builder /opt/swift-bitcoin/.build/aarch64-swift-linux-musl/release/bcutil /usr/local/bin/ | ||
COPY --from=builder /opt/swift-bitcoin/.build/swift-linux-musl/release/bcutil /usr/local/bin/ | ||
ENTRYPOINT ["/usr/local/bin/bcutil"] | ||
|
||
FROM scratch AS bcnode | ||
COPY --from=builder /opt/swift-bitcoin/.build/aarch64-swift-linux-musl/release/bcnode /usr/local/bin/ | ||
COPY --from=builder /opt/swift-bitcoin/.build/swift-linux-musl/release/bcnode /usr/local/bin/ | ||
ENTRYPOINT ["/usr/local/bin/bcnode"] |
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