Skip to content

Commit 7967683

Browse files
authored
Merge pull request #249 from apple/add-swift-5.5
Add support for Swift 5.5 Docker images
2 parents a237eeb + 5cbc62d commit 7967683

File tree

12 files changed

+584
-0
lines changed

12 files changed

+584
-0
lines changed

5.5/amazonlinux/2/Dockerfile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
FROM amazonlinux:2
2+
LABEL maintainer="Swift Infrastructure <[email protected]>"
3+
LABEL description="Docker Container for the Swift programming language"
4+
5+
RUN yum -y install \
6+
binutils \
7+
gcc \
8+
git \
9+
glibc-static \
10+
gzip \
11+
libbsd \
12+
libcurl \
13+
libedit \
14+
libicu \
15+
libsqlite \
16+
libstdc++-static \
17+
libuuid \
18+
libxml2 \
19+
tar \
20+
tzdata \
21+
zlib-devel
22+
23+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
24+
25+
# pub 4096R/ED3D1561 2019-03-22 [SC] [expires: 2023-03-23]
26+
# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561
27+
# uid Swift 5.x Release Signing Key <[email protected]
28+
ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
29+
ARG SWIFT_PLATFORM=amazonlinux2
30+
ARG SWIFT_BRANCH=swift-5.5-release
31+
ARG SWIFT_VERSION=swift-5.5-RELEASE
32+
ARG SWIFT_WEBROOT=https://swift.org/builds/
33+
34+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
35+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
36+
SWIFT_BRANCH=$SWIFT_BRANCH \
37+
SWIFT_VERSION=$SWIFT_VERSION \
38+
SWIFT_WEBROOT=$SWIFT_WEBROOT
39+
40+
RUN set -e; \
41+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)/" \
42+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz" \
43+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
44+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
45+
&& export GNUPGHOME="$(mktemp -d)" \
46+
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
47+
&& gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \
48+
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
49+
# - Unpack the toolchain, set libs permissions, and clean up.
50+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 \
51+
&& chmod -R o+r /usr/lib/swift \
52+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz
53+
54+
# Print Installed Swift Version
55+
RUN swift --version

5.5/amazonlinux/2/slim/Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM amazonlinux:2
2+
LABEL maintainer="Swift Infrastructure <[email protected]>"
3+
LABEL description="Docker Container for the Swift programming language"
4+
5+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
6+
7+
# pub 4096R/ED3D1561 2019-03-22 [SC] [expires: 2023-03-23]
8+
# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561
9+
# uid Swift 5.x Release Signing Key <[email protected]
10+
ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
11+
ARG SWIFT_PLATFORM=amazonlinux2
12+
ARG SWIFT_BRANCH=swift-5.5-release
13+
ARG SWIFT_VERSION=swift-5.5-RELEASE
14+
ARG SWIFT_WEBROOT=https://swift.org/builds/
15+
16+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
17+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
18+
SWIFT_BRANCH=$SWIFT_BRANCH \
19+
SWIFT_VERSION=$SWIFT_VERSION \
20+
SWIFT_WEBROOT=$SWIFT_WEBROOT
21+
22+
RUN set -e; \
23+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)/" \
24+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz" \
25+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
26+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
27+
&& export GNUPGHOME="$(mktemp -d)" \
28+
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
29+
&& gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \
30+
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
31+
# - Unpack the toolchain, set libs permissions, and clean up.
32+
&& yum -y install tar gzip \
33+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 $SWIFT_VERSION-$SWIFT_PLATFORM/usr/lib/swift/linux \
34+
&& chmod -R o+r /usr/lib/swift \
35+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \
36+
&& yum autoremove -y tar gzip

5.5/centos/7/Dockerfile

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
FROM centos:7
2+
LABEL maintainer="Swift Infrastructure <[email protected]>"
3+
LABEL description="Docker Container for the Swift programming language"
4+
5+
RUN yum install shadow-utils.x86_64 -y \
6+
binutils \
7+
gcc \
8+
git \
9+
glibc-static \
10+
libbsd-devel \
11+
libedit \
12+
libedit-devel \
13+
libicu-devel \
14+
libstdc++-static \
15+
pkg-config \
16+
python3 \
17+
sqlite \
18+
zlib-devel
19+
20+
RUN sed -i -e 's/\*__block/\*__libc_block/g' /usr/include/unistd.h
21+
22+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
23+
24+
# pub 4096R/ED3D1561 2019-03-22 [SC] [expires: 2023-03-23]
25+
# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561
26+
# uid Swift 5.x Release Signing Key <[email protected]
27+
ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
28+
ARG SWIFT_PLATFORM=centos7
29+
ARG SWIFT_BRANCH=swift-5.5-release
30+
ARG SWIFT_VERSION=swift-5.5-RELEASE
31+
ARG SWIFT_WEBROOT=https://swift.org/builds/
32+
33+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
34+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
35+
SWIFT_BRANCH=$SWIFT_BRANCH \
36+
SWIFT_VERSION=$SWIFT_VERSION \
37+
SWIFT_WEBROOT=$SWIFT_WEBROOT
38+
39+
RUN set -e; \
40+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)/" \
41+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz" \
42+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
43+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
44+
&& export GNUPGHOME="$(mktemp -d)" \
45+
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
46+
&& gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \
47+
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
48+
# - Unpack the toolchain, set libs permissions, and clean up.
49+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 \
50+
&& chmod -R o+r /usr/lib/swift \
51+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz
52+
53+
# Print Installed Swift Version
54+
RUN swift --version

5.5/centos/7/slim/Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM centos:7
2+
LABEL maintainer="Swift Infrastructure <[email protected]>"
3+
LABEL description="Docker Container for the Swift programming language"
4+
5+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
6+
7+
# pub 4096R/ED3D1561 2019-03-22 [SC] [expires: 2023-03-23]
8+
# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561
9+
# uid Swift 5.x Release Signing Key <[email protected]
10+
ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
11+
ARG SWIFT_PLATFORM=centos7
12+
ARG SWIFT_BRANCH=swift-5.5-release
13+
ARG SWIFT_VERSION=swift-5.5-RELEASE
14+
ARG SWIFT_WEBROOT=https://swift.org/builds/
15+
16+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
17+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
18+
SWIFT_BRANCH=$SWIFT_BRANCH \
19+
SWIFT_VERSION=$SWIFT_VERSION \
20+
SWIFT_WEBROOT=$SWIFT_WEBROOT
21+
22+
RUN set -e; \
23+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)/" \
24+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz" \
25+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
26+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
27+
&& export GNUPGHOME="$(mktemp -d)" \
28+
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
29+
&& gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \
30+
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
31+
# - Unpack the toolchain, set libs permissions, and clean up.
32+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 $SWIFT_VERSION-$SWIFT_PLATFORM/usr/lib/swift/linux \
33+
&& chmod -R o+r /usr/lib/swift \
34+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz

5.5/centos/8/Dockerfile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
FROM centos:8
2+
LABEL maintainer="Swift Infrastructure <[email protected]>"
3+
LABEL description="Docker Container for the Swift programming language"
4+
5+
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
6+
7+
RUN yum install --enablerepo=powertools -y \
8+
binutils \
9+
gcc \
10+
git \
11+
glibc-static \
12+
libbsd-devel \
13+
libedit \
14+
libedit-devel \
15+
libicu-devel \
16+
libstdc++-static \
17+
pkg-config \
18+
python3 \
19+
sqlite \
20+
zlib-devel
21+
22+
RUN ln -s /usr/bin/python3 /usr/bin/python
23+
24+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
25+
26+
# pub 4096R/ED3D1561 2019-03-22 [SC] [expires: 2023-03-23]
27+
# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561
28+
# uid Swift 5.x Release Signing Key <[email protected]
29+
ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
30+
ARG SWIFT_PLATFORM=centos8
31+
ARG SWIFT_BRANCH=swift-5.5-release
32+
ARG SWIFT_VERSION=swift-5.5-RELEASE
33+
ARG SWIFT_WEBROOT=https://swift.org/builds/
34+
35+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
36+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
37+
SWIFT_BRANCH=$SWIFT_BRANCH \
38+
SWIFT_VERSION=$SWIFT_VERSION \
39+
SWIFT_WEBROOT=$SWIFT_WEBROOT
40+
41+
RUN set -e; \
42+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)/" \
43+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz" \
44+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
45+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
46+
&& export GNUPGHOME="$(mktemp -d)" \
47+
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
48+
&& gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \
49+
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
50+
# - Unpack the toolchain, set libs permissions, and clean up.
51+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 \
52+
&& chmod -R o+r /usr/lib/swift \
53+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz
54+
55+
# Print Installed Swift Version
56+
RUN swift --version

5.5/centos/8/slim/Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM centos:8
2+
LABEL maintainer="Swift Infrastructure <[email protected]>"
3+
LABEL description="Docker Container for the Swift programming language"
4+
5+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
6+
7+
# pub 4096R/ED3D1561 2019-03-22 [SC] [expires: 2023-03-23]
8+
# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561
9+
# uid Swift 5.x Release Signing Key <[email protected]
10+
ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
11+
ARG SWIFT_PLATFORM=centos8
12+
ARG SWIFT_BRANCH=swift-5.5-release
13+
ARG SWIFT_VERSION=swift-5.5-RELEASE
14+
ARG SWIFT_WEBROOT=https://swift.org/builds/
15+
16+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
17+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
18+
SWIFT_BRANCH=$SWIFT_BRANCH \
19+
SWIFT_VERSION=$SWIFT_VERSION \
20+
SWIFT_WEBROOT=$SWIFT_WEBROOT
21+
22+
RUN set -e; \
23+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)/" \
24+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz" \
25+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
26+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
27+
&& export GNUPGHOME="$(mktemp -d)" \
28+
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
29+
&& gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \
30+
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
31+
# - Unpack the toolchain, set libs permissions, and clean up.
32+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 $SWIFT_VERSION-$SWIFT_PLATFORM/usr/lib/swift/linux \
33+
&& chmod -R o+r /usr/lib/swift \
34+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz

5.5/ubuntu/16.04/Dockerfile

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
FROM ubuntu:16.04
2+
LABEL maintainer="Swift Infrastructure <[email protected]>"
3+
LABEL Description="Docker Container for the Swift programming language"
4+
5+
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \
6+
apt-get -q install -y \
7+
libatomic1 \
8+
libcurl3 \
9+
libxml2 \
10+
libedit2 \
11+
libsqlite3-0 \
12+
libc6-dev \
13+
binutils \
14+
libgcc-5-dev \
15+
libstdc++-5-dev \
16+
zlib1g-dev \
17+
libpython3.5 \
18+
tzdata \
19+
git \
20+
pkg-config \
21+
&& rm -r /var/lib/apt/lists/*
22+
23+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
24+
25+
# pub 4096R/ED3D1561 2019-03-22 [SC] [expires: 2023-03-23]
26+
# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561
27+
# uid Swift 5.x Release Signing Key <[email protected]
28+
ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
29+
ARG SWIFT_PLATFORM=ubuntu16.04
30+
ARG SWIFT_BRANCH=swift-5.5-release
31+
ARG SWIFT_VERSION=swift-5.5-RELEASE
32+
ARG SWIFT_WEBROOT=https://swift.org/builds/
33+
34+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
35+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
36+
SWIFT_BRANCH=$SWIFT_BRANCH \
37+
SWIFT_VERSION=$SWIFT_VERSION \
38+
SWIFT_WEBROOT=$SWIFT_WEBROOT
39+
40+
RUN set -e; \
41+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)/" \
42+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz" \
43+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
44+
# - Grab curl here so we cache better up above
45+
&& export DEBIAN_FRONTEND=noninteractive \
46+
&& apt-get -q update && apt-get -q install -y curl && rm -rf /var/lib/apt/lists/* \
47+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
48+
&& export GNUPGHOME="$(mktemp -d)" \
49+
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
50+
&& gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \
51+
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
52+
# - Unpack the toolchain, set libs permissions, and clean up.
53+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 \
54+
&& chmod -R o+r /usr/lib/swift \
55+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \
56+
&& apt-get purge --auto-remove -y curl
57+
58+
# Print Installed Swift Version
59+
RUN swift --version

5.5/ubuntu/16.04/slim/Dockerfile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
FROM ubuntu:16.04
2+
LABEL maintainer="Swift Infrastructure <[email protected]>"
3+
LABEL Description="Docker Container for the Swift programming language"
4+
5+
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \
6+
apt-get -q install -y \
7+
libatomic1 \
8+
libcurl3 \
9+
libxml2 \
10+
tzdata \
11+
&& rm -r /var/lib/apt/lists/*
12+
13+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
14+
15+
# pub 4096R/ED3D1561 2019-03-22 [SC] [expires: 2023-03-23]
16+
# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561
17+
# uid Swift 5.x Release Signing Key <[email protected]
18+
ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
19+
ARG SWIFT_PLATFORM=ubuntu16.04
20+
ARG SWIFT_BRANCH=swift-5.5-release
21+
ARG SWIFT_VERSION=swift-5.5-RELEASE
22+
ARG SWIFT_WEBROOT=https://swift.org/builds/
23+
24+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
25+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
26+
SWIFT_BRANCH=$SWIFT_BRANCH \
27+
SWIFT_VERSION=$SWIFT_VERSION \
28+
SWIFT_WEBROOT=$SWIFT_WEBROOT
29+
30+
RUN set -e; \
31+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)/" \
32+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz" \
33+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
34+
# - Grab curl here so we cache better up above
35+
&& export DEBIAN_FRONTEND=noninteractive \
36+
&& apt-get -q update && apt-get -q install -y curl && rm -rf /var/lib/apt/lists/* \
37+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
38+
&& export GNUPGHOME="$(mktemp -d)" \
39+
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
40+
&& gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \
41+
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
42+
# - Unpack the toolchain, set libs permissions, and clean up.
43+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 $SWIFT_VERSION-$SWIFT_PLATFORM/usr/lib/swift/linux \
44+
&& chmod -R o+r /usr/lib/swift \
45+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \
46+
&& apt-get purge --auto-remove -y curl

0 commit comments

Comments
 (0)