Skip to content

Commit

Permalink
Add support to build ARM64 images
Browse files Browse the repository at this point in the history
Signed-off-by: odidev <[email protected]>
  • Loading branch information
odidev committed Mar 9, 2021
1 parent a270908 commit 61f1260
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions 5.3/ubuntu/18.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,23 @@ RUN set -e; \
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
# - Grab curl here so we cache better up above
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get -q update && apt-get -q install -y curl && rm -rf /var/lib/apt/lists/* \
&& apt-get -q update && apt-get -q install -y curl sudo wget && rm -rf /var/lib/apt/lists/* \
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
&& export GNUPGHOME="$(mktemp -d)" \
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
&& gpg --batch --quiet --keyserver ha.pool.sks-keyservers.net --recv-keys "$SWIFT_SIGNING_KEY" \
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
# - Unpack the toolchain, set libs permissions, and clean up.
&& tar -xzf swift.tar.gz --directory / --strip-components=1 \
&& chmod -R o+r /usr/lib/swift \
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \
&& apt-get purge --auto-remove -y curl
&& if [ `uname -m` = "aarch64" ] ; then \
wget https://github.com/futurejones/swift-arm64/releases/download/v5.3.3-RELEASE/swiftlang-5.3.3-ubuntu-18.04-release-aarch64-4-2021-02-01.tar.gz && \
tar -xf swiftlang-5.3.3-ubuntu-18.04-release-aarch64-4-2021-02-01.tar.gz --directory / --strip-components=1 && \
export PATH=usr/bin:$PATH && \
rm -rf swiftlang-5.3.3-ubuntu-18.04-release-aarch64-4-2021-02-01.tar.gz; \
else \
curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
&& gpg --batch --quiet --keyserver ha.pool.sks-keyservers.net --recv-keys "$SWIFT_SIGNING_KEY" \
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
&& tar -xzf swift.tar.gz --directory / --strip-components=1 \
&& chmod -R o+r /usr/lib/swift \
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz; \
fi \
&& apt-get purge --auto-remove -y curl wget

# Print Installed Swift Version
RUN swift --version

0 comments on commit 61f1260

Please sign in to comment.