Skip to content

Commit 070dfd5

Browse files
authored
Swift 6.1 Release Dockerfiles (#456)
1 parent 0e6e138 commit 070dfd5

File tree

16 files changed

+1176
-0
lines changed

16 files changed

+1176
-0
lines changed

6.1/amazonlinux/2/Dockerfile

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
FROM amazonlinux:2
2+
LABEL maintainer="Swift Infrastructure <swift-infrastructure@forums.swift.org>"
3+
LABEL description="Docker Container for the Swift programming language"
4+
5+
RUN yum -y install \
6+
binutils \
7+
gcc \
8+
git \
9+
unzip \
10+
glibc-static \
11+
gzip \
12+
libbsd \
13+
libcurl-devel \
14+
libedit \
15+
libicu \
16+
libsqlite \
17+
libstdc++-static \
18+
libuuid \
19+
libxml2-devel \
20+
openssl-devel \
21+
tar \
22+
tzdata \
23+
zlib-devel
24+
25+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
26+
27+
# pub rsa4096 2024-09-16 [SC] [expires: 2026-09-16]
28+
# 52BB7E3DE28A71BE22EC05FFEF80A866B47A981F
29+
# uid [ unknown] Swift 6.x Release Signing Key <swift-infrastructure@forums.swift.org>
30+
ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F
31+
ARG SWIFT_PLATFORM=amazonlinux2
32+
ARG SWIFT_BRANCH=swift-6.1-release
33+
ARG SWIFT_VERSION=swift-6.1-RELEASE
34+
ARG SWIFT_WEBROOT=https://download.swift.org
35+
36+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
37+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
38+
SWIFT_BRANCH=$SWIFT_BRANCH \
39+
SWIFT_VERSION=$SWIFT_VERSION \
40+
SWIFT_WEBROOT=$SWIFT_WEBROOT
41+
42+
RUN set -e; \
43+
ARCH_NAME="$(rpm --eval '%{_arch}')"; \
44+
url=; \
45+
case "${ARCH_NAME##*-}" in \
46+
'x86_64') \
47+
OS_ARCH_SUFFIX=''; \
48+
;; \
49+
'aarch64') \
50+
OS_ARCH_SUFFIX='-aarch64'; \
51+
;; \
52+
*) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \
53+
esac; \
54+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \
55+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \
56+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
57+
&& echo $SWIFT_BIN_URL \
58+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
59+
&& export GNUPGHOME="$(mktemp -d)" \
60+
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
61+
&& gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \
62+
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
63+
# - Unpack the toolchain, set libs permissions, and clean up.
64+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 \
65+
&& chmod -R o+r /usr/lib/swift \
66+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz
67+
68+
# Print Installed Swift Version
69+
RUN swift --version

6.1/amazonlinux/2/slim/Dockerfile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
FROM amazonlinux:2
2+
LABEL maintainer="Swift Infrastructure <swift-infrastructure@forums.swift.org>"
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 rsa4096 2024-09-16 [SC] [expires: 2026-09-16]
8+
# 52BB7E3DE28A71BE22EC05FFEF80A866B47A981F
9+
# uid [ unknown] Swift 6.x Release Signing Key <swift-infrastructure@forums.swift.org>
10+
ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F
11+
ARG SWIFT_PLATFORM=amazonlinux2
12+
ARG SWIFT_BRANCH=swift-6.1-release
13+
ARG SWIFT_VERSION=swift-6.1-RELEASE
14+
ARG SWIFT_WEBROOT=https://download.swift.org
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+
ARCH_NAME="$(rpm --eval '%{_arch}')"; \
24+
url=; \
25+
case "${ARCH_NAME##*-}" in \
26+
'x86_64') \
27+
OS_ARCH_SUFFIX=''; \
28+
;; \
29+
'aarch64') \
30+
OS_ARCH_SUFFIX='-aarch64'; \
31+
;; \
32+
*) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \
33+
esac; \
34+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \
35+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \
36+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
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+
&& yum -y install tar gzip \
44+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 \
45+
$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/lib/swift/linux \
46+
$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/libexec/swift/linux \
47+
&& chmod -R o+r /usr/lib/swift /usr/libexec/swift \
48+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \
49+
&& yum autoremove -y tar gzip

6.1/debian/12/Dockerfile

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
FROM debian:12
2+
3+
LABEL maintainer="Swift Infrastructure <swift-infrastructure@forums.swift.org>"
4+
LABEL description="Docker Container for the Swift programming language"
5+
6+
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \
7+
apt-get -q install -y \
8+
binutils-gold \
9+
libicu-dev \
10+
libcurl4-openssl-dev \
11+
libedit-dev \
12+
libsqlite3-dev \
13+
libncurses-dev \
14+
libpython3-dev \
15+
libxml2-dev \
16+
pkg-config \
17+
uuid-dev \
18+
tzdata \
19+
git \
20+
gcc \
21+
libstdc++-12-dev \
22+
&& rm -r /var/lib/apt/lists/*
23+
24+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
25+
26+
# pub rsa4096 2024-09-16 [SC] [expires: 2026-09-16]
27+
# 52BB7E3DE28A71BE22EC05FFEF80A866B47A981F
28+
# uid [ unknown] Swift 6.x Release Signing Key <swift-infrastructure@forums.swift.org>
29+
ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F
30+
ARG SWIFT_PLATFORM=debian12
31+
ARG SWIFT_BRANCH=swift-6.1-release
32+
ARG SWIFT_VERSION=swift-6.1-RELEASE
33+
ARG SWIFT_WEBROOT=https://download.swift.org
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+
ARCH_NAME="$(dpkg --print-architecture)"; \
43+
url=; \
44+
case "${ARCH_NAME##*-}" in \
45+
'amd64') \
46+
OS_ARCH_SUFFIX=''; \
47+
;; \
48+
'arm64') \
49+
OS_ARCH_SUFFIX='-aarch64'; \
50+
;; \
51+
*) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \
52+
esac; \
53+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \
54+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \
55+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
56+
# - Grab curl and gpg here so we cache better up above
57+
&& export DEBIAN_FRONTEND=noninteractive \
58+
&& apt-get -q update && apt-get -q install -y curl gpg && rm -rf /var/lib/apt/lists/* \
59+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
60+
&& export GNUPGHOME="$(mktemp -d)" \
61+
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
62+
&& gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \
63+
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
64+
# - Unpack the toolchain, set libs permissions, and clean up.
65+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 \
66+
&& chmod -R o+r /usr/lib/swift \
67+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \
68+
&& apt-get purge --auto-remove -y curl gpg
69+
70+
# Print Installed Swift Version
71+
RUN swift --version

6.1/debian/12/slim/Dockerfile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
FROM debian:12
2+
LABEL maintainer="Swift Infrastructure <swift-infrastructure@forums.swift.org>"
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+
libcurl4 \
8+
libxml2 \
9+
tzdata \
10+
&& rm -r /var/lib/apt/lists/*
11+
12+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
13+
14+
# pub rsa4096 2024-09-16 [SC] [expires: 2026-09-16]
15+
# 52BB7E3DE28A71BE22EC05FFEF80A866B47A981F
16+
# uid [ unknown] Swift 6.x Release Signing Key <swift-infrastructure@forums.swift.org>
17+
ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F
18+
ARG SWIFT_PLATFORM=debian12
19+
ARG SWIFT_BRANCH=swift-6.1-release
20+
ARG SWIFT_VERSION=swift-6.1-RELEASE
21+
ARG SWIFT_WEBROOT=https://download.swift.org
22+
23+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
24+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
25+
SWIFT_BRANCH=$SWIFT_BRANCH \
26+
SWIFT_VERSION=$SWIFT_VERSION \
27+
SWIFT_WEBROOT=$SWIFT_WEBROOT
28+
29+
RUN set -e; \
30+
ARCH_NAME="$(dpkg --print-architecture)"; \
31+
url=; \
32+
case "${ARCH_NAME##*-}" in \
33+
'amd64') \
34+
OS_ARCH_SUFFIX=''; \
35+
;; \
36+
'arm64') \
37+
OS_ARCH_SUFFIX='-aarch64'; \
38+
;; \
39+
*) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \
40+
esac; \
41+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \
42+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \
43+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
44+
# - Grab curl and gpg here so we cache better up above
45+
&& export DEBIAN_FRONTEND=noninteractive \
46+
&& apt-get -q update && apt-get -q install -y curl gpg && 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+
$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/lib/swift/linux \
55+
$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/libexec/swift/linux \
56+
&& chmod -R o+r /usr/lib/swift /usr/libexec/swift \
57+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \
58+
&& apt-get purge --auto-remove -y curl gpg

6.1/fedora/39/Dockerfile

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
FROM fedora:39
2+
3+
LABEL maintainer="Swift Infrastructure <swift-infrastructure@forums.swift.org>"
4+
LABEL description="Docker Container for the Swift programming language"
5+
6+
RUN yum -y install \
7+
binutils \
8+
gcc \
9+
git \
10+
unzip \
11+
libcurl-devel \
12+
libedit-devel \
13+
libicu-devel \
14+
sqlite-devel \
15+
libuuid-devel \
16+
libxml2-devel \
17+
python3-devel \
18+
libstdc++-devel \
19+
libstdc++-static
20+
21+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
22+
23+
# pub rsa4096 2024-09-16 [SC] [expires: 2026-09-16]
24+
# 52BB7E3DE28A71BE22EC05FFEF80A866B47A981F
25+
# uid [ unknown] Swift 6.x Release Signing Key <swift-infrastructure@forums.swift.org>
26+
ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F
27+
ARG SWIFT_PLATFORM=fedora39
28+
ARG SWIFT_BRANCH=swift-6.1-release
29+
ARG SWIFT_VERSION=swift-6.1-RELEASE
30+
ARG SWIFT_WEBROOT=https://download.swift.org
31+
32+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
33+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
34+
SWIFT_BRANCH=$SWIFT_BRANCH \
35+
SWIFT_VERSION=$SWIFT_VERSION \
36+
SWIFT_WEBROOT=$SWIFT_WEBROOT
37+
38+
RUN set -e; \
39+
ARCH_NAME="$(rpm --eval '%{_arch}')"; \
40+
url=; \
41+
case "${ARCH_NAME##*-}" in \
42+
'x86_64') \
43+
OS_ARCH_SUFFIX=''; \
44+
;; \
45+
'aarch64') \
46+
OS_ARCH_SUFFIX='-aarch64'; \
47+
;; \
48+
*) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \
49+
esac; \
50+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \
51+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \
52+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
53+
&& echo $SWIFT_BIN_URL \
54+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
55+
&& export GNUPGHOME="$(mktemp -d)" \
56+
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
57+
&& gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \
58+
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
59+
# - Unpack the toolchain, set libs permissions, and clean up.
60+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 \
61+
&& chmod -R o+r /usr/lib/swift \
62+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz
63+
64+
# Print Installed Swift Version
65+
RUN swift --version

6.1/fedora/39/slim/Dockerfile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
FROM fedora:39
2+
3+
LABEL maintainer="Swift Infrastructure <swift-infrastructure@forums.swift.org>"
4+
LABEL description="Docker Container for the Swift programming language"
5+
6+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
7+
8+
# pub rsa4096 2024-09-16 [SC] [expires: 2026-09-16]
9+
# 52BB7E3DE28A71BE22EC05FFEF80A866B47A981F
10+
# uid [ unknown] Swift 6.x Release Signing Key <swift-infrastructure@forums.swift.org>
11+
ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F
12+
ARG SWIFT_PLATFORM=fedora39
13+
ARG SWIFT_BRANCH=swift-6.1-release
14+
ARG SWIFT_VERSION=swift-6.1-RELEASE
15+
ARG SWIFT_WEBROOT=https://download.swift.org
16+
17+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
18+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
19+
SWIFT_BRANCH=$SWIFT_BRANCH \
20+
SWIFT_VERSION=$SWIFT_VERSION \
21+
SWIFT_WEBROOT=$SWIFT_WEBROOT
22+
23+
RUN set -ex; \
24+
ARCH_NAME="$(rpm --eval '%{_arch}')"; \
25+
url=; \
26+
case "${ARCH_NAME##*-}" in \
27+
'x86_64') \
28+
OS_ARCH_SUFFIX=''; \
29+
;; \
30+
'aarch64') \
31+
OS_ARCH_SUFFIX='-aarch64'; \
32+
;; \
33+
*) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \
34+
esac; \
35+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \
36+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \
37+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
38+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
39+
&& export GNUPGHOME="$(mktemp -d)" \
40+
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
41+
&& gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \
42+
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
43+
# - Unpack the toolchain, set libs permissions, and clean up.
44+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 \
45+
$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/lib/swift/linux \
46+
$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/libexec/swift/linux \
47+
&& chmod -R o+r /usr/lib/swift /usr/libexec/swift \
48+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz

0 commit comments

Comments
 (0)