Skip to content

Commit e4201a1

Browse files
authored
Swift 5.10: Adding Slim Dockerfiles for new distros (#392)
* [5.10] Debian 12 slim Dockerfile * [5.10] Fedora 39 slim Dockerfile * [5.10] Ubuntu 23.10 Slim Dockerfile * [5.10] Ubuntu 24.04 Slim Dockerfile
1 parent 12d3b34 commit e4201a1

File tree

4 files changed

+224
-0
lines changed

4 files changed

+224
-0
lines changed

5.10/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 <[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+
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 4096R/ED3D1561 2019-03-22 [SC] [expires: 2023-03-23]
15+
# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561
16+
# uid Swift 5.x Release Signing Key <[email protected]
17+
ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
18+
ARG SWIFT_PLATFORM=debian12
19+
ARG SWIFT_BRANCH=swift-5.10.1-release
20+
ARG SWIFT_VERSION=swift-5.10.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

5.10/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 <[email protected]>"
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 4096R/ED3D1561 2019-03-22 [SC] [expires: 2023-03-23]
9+
# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561
10+
# uid Swift 5.x Release Signing Key <[email protected]
11+
ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
12+
ARG SWIFT_PLATFORM=fedora39
13+
ARG SWIFT_BRANCH=swift-5.10.1-release
14+
ARG SWIFT_VERSION=swift-5.10.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

5.10/ubuntu/23.10/slim/Dockerfile

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
FROM ubuntu:23.10
2+
3+
LABEL maintainer="Swift Infrastructure <[email protected]>"
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+
libcurl4 \
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=ubuntu23.10
20+
ARG SWIFT_BRANCH=swift-5.10.1-release
21+
ARG SWIFT_VERSION=swift-5.10.1-RELEASE
22+
ARG SWIFT_WEBROOT=https://download.swift.org
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+
ARCH_NAME="$(dpkg --print-architecture)"; \
32+
url=; \
33+
case "${ARCH_NAME##*-}" in \
34+
'amd64') \
35+
OS_ARCH_SUFFIX=''; \
36+
;; \
37+
'arm64') \
38+
OS_ARCH_SUFFIX='-aarch64'; \
39+
;; \
40+
*) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \
41+
esac; \
42+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \
43+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \
44+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
45+
# - Grab curl and gpg here so we cache better up above
46+
&& export DEBIAN_FRONTEND=noninteractive \
47+
&& apt-get -q update && apt-get -q install -y curl gnupg && rm -rf /var/lib/apt/lists/* \
48+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
49+
&& export GNUPGHOME="$(mktemp -d)" \
50+
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
51+
&& gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \
52+
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
53+
# - Unpack the toolchain, set libs permissions, and clean up.
54+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 \
55+
$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/lib/swift/linux \
56+
$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/libexec/swift/linux \
57+
&& chmod -R o+r /usr/lib/swift /usr/libexec/swift \
58+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \
59+
&& apt-get purge --auto-remove -y curl gnupg

5.10/ubuntu/24.04/slim/Dockerfile

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
FROM ubuntu:24.04
2+
3+
LABEL maintainer="Swift Infrastructure <[email protected]>"
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+
libcurl4 \
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=ubuntu24.04
20+
ARG SWIFT_BRANCH=swift-5.10.1-release
21+
ARG SWIFT_VERSION=swift-5.10.1-RELEASE
22+
ARG SWIFT_WEBROOT=https://download.swift.org
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+
ARCH_NAME="$(dpkg --print-architecture)"; \
32+
url=; \
33+
case "${ARCH_NAME##*-}" in \
34+
'amd64') \
35+
OS_ARCH_SUFFIX=''; \
36+
;; \
37+
'arm64') \
38+
OS_ARCH_SUFFIX='-aarch64'; \
39+
;; \
40+
*) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \
41+
esac; \
42+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \
43+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \
44+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
45+
# - Grab curl and gpg here so we cache better up above
46+
&& export DEBIAN_FRONTEND=noninteractive \
47+
&& apt-get -q update && apt-get -q install -y curl gnupg && rm -rf /var/lib/apt/lists/* \
48+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
49+
&& export GNUPGHOME="$(mktemp -d)" \
50+
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
51+
&& gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \
52+
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
53+
# - Unpack the toolchain, set libs permissions, and clean up.
54+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 \
55+
$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/lib/swift/linux \
56+
$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/libexec/swift/linux \
57+
&& chmod -R o+r /usr/lib/swift /usr/libexec/swift \
58+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \
59+
&& apt-get purge --auto-remove -y curl gnupg

0 commit comments

Comments
 (0)