Skip to content

Commit 594ab4b

Browse files
authored
Merge pull request #301 from apple/support-ubuntu-22.04
Support Ubuntu 22.04
2 parents 912a2a6 + 16e8bc1 commit 594ab4b

File tree

4 files changed

+218
-1
lines changed

4 files changed

+218
-1
lines changed

nightly-main/ubuntu/20.04/slim/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && ap
1717
# uid [ unknown] Swift Automatic Signing Key #3 <[email protected]>
1818
ARG SWIFT_SIGNING_KEY=8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
1919
ARG SWIFT_PLATFORM=ubuntu
20-
ARG OS_MAJOR_VER=18
20+
ARG OS_MAJOR_VER=20
2121
ARG OS_MIN_VER=04
2222
ARG SWIFT_WEBROOT=https://download.swift.org/development
2323

nightly-main/ubuntu/22.04/Dockerfile

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
FROM ubuntu:22.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+
binutils \
8+
git \
9+
gnupg2 \
10+
libc6-dev \
11+
libcurl4-openssl-dev \
12+
libedit2 \
13+
libgcc-9-dev \
14+
libpython3.8 \
15+
libsqlite3-0 \
16+
libstdc++-9-dev \
17+
libxml2-dev \
18+
libz3-dev \
19+
pkg-config \
20+
tzdata \
21+
zlib1g-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+
# gpg --keyid-format LONG -k FAF6989E1BC16FEA
27+
# pub rsa4096/FAF6989E1BC16FEA 2019-11-07 [SC] [expires: 2021-11-06]
28+
# 8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
29+
# uid [ unknown] Swift Automatic Signing Key #3 <[email protected]>
30+
ARG SWIFT_SIGNING_KEY=8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
31+
ARG SWIFT_PLATFORM=ubuntu
32+
ARG OS_MAJOR_VER=22
33+
ARG OS_MIN_VER=04
34+
ARG SWIFT_WEBROOT=https://download.swift.org/development
35+
36+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
37+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
38+
OS_MAJOR_VER=$OS_MAJOR_VER \
39+
OS_MIN_VER=$OS_MIN_VER \
40+
OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER.$OS_MIN_VER \
41+
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MIN_VER"
42+
43+
RUN echo "${SWIFT_WEBROOT}/latest-build.yml"
44+
45+
RUN set -e; \
46+
# - Grab curl here so we cache better up above
47+
export DEBIAN_FRONTEND=noninteractive \
48+
&& apt-get -q update && apt-get -q install -y curl && rm -rf /var/lib/apt/lists/* \
49+
# - Latest Toolchain info
50+
&& export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \
51+
&& export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \
52+
&& export DOWNLOAD_DIR=$(echo $download | sed "s/-${OS_VER}.tar.gz//g") \
53+
&& echo $DOWNLOAD_DIR > .swift_tag \
54+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
55+
&& export GNUPGHOME="$(mktemp -d)" \
56+
&& curl -fsSL ${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \
57+
${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \
58+
&& curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \
59+
&& gpg --batch --verify latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
60+
# - Unpack the toolchain, set libs permissions, and clean up.
61+
&& tar -xzf latest_toolchain.tar.gz --directory / --strip-components=1 \
62+
&& chmod -R o+r /usr/lib/swift \
63+
&& rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
64+
&& apt-get purge --auto-remove -y curl
65+
66+
# Print Installed Swift Version
67+
RUN swift --version
68+
69+
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
70+
>> /etc/bash.bashrc; \
71+
echo " ################################################################\n" \
72+
"#\t\t\t\t\t\t\t\t#\n" \
73+
"# Swift Nightly Docker Image\t\t\t\t\t#\n" \
74+
"# Tag: $(cat .swift_tag)\t\t\t#\n" \
75+
"#\t\t\t\t\t\t\t\t#\n" \
76+
"################################################################\n" > /etc/motd
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
FROM ubuntu:22.04 AS base
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+
binutils \
8+
git \
9+
gnupg2 \
10+
libc6-dev \
11+
libcurl4-openssl-dev \
12+
libedit2 \
13+
libgcc-9-dev \
14+
libpython3.8 \
15+
libsqlite3-0 \
16+
libstdc++-9-dev \
17+
libxml2-dev \
18+
libz3-dev \
19+
pkg-config \
20+
tzdata \
21+
zlib1g-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+
# gpg --keyid-format LONG -k FAF6989E1BC16FEA
27+
# pub rsa4096/FAF6989E1BC16FEA 2019-11-07 [SC] [expires: 2021-11-06]
28+
# 8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
29+
# uid [ unknown] Swift Automatic Signing Key #3 <[email protected]>
30+
ARG SWIFT_SIGNING_KEY=8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
31+
ARG SWIFT_PLATFORM=ubuntu
32+
ARG OS_MAJOR_VER=22
33+
ARG OS_MIN_VER=04
34+
ARG SWIFT_WEBROOT=https://download.swift.org/development
35+
36+
# This is a small trick to enable if/else for arm64 and amd64.
37+
# Because of https://bugs.swift.org/browse/SR-14872 we need adjust tar options.
38+
FROM base AS base-amd64
39+
ARG OS_ARCH_SUFFIX=
40+
41+
FROM base AS base-arm64
42+
ARG OS_ARCH_SUFFIX=-aarch64
43+
44+
FROM base-$TARGETARCH AS final
45+
46+
ARG OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER.$OS_MIN_VER$OS_ARCH_SUFFIX
47+
ARG PLATFORM_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MIN_VER$OS_ARCH_SUFFIX"
48+
49+
RUN echo "${PLATFORM_WEBROOT}/latest-build.yml"
50+
51+
RUN set -e; \
52+
# - Grab curl here so we cache better up above
53+
export DEBIAN_FRONTEND=noninteractive \
54+
&& apt-get -q update && apt-get -q install -y curl && rm -rf /var/lib/apt/lists/* \
55+
# - Latest Toolchain info
56+
&& export $(curl -s ${PLATFORM_WEBROOT}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \
57+
&& export $(curl -s ${PLATFORM_WEBROOT}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \
58+
&& export DOWNLOAD_DIR=$(echo $download | sed "s/-${OS_VER}.tar.gz//g") \
59+
&& echo $DOWNLOAD_DIR > .swift_tag \
60+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
61+
&& export GNUPGHOME="$(mktemp -d)" \
62+
&& curl -fsSL ${PLATFORM_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \
63+
${PLATFORM_WEBROOT}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \
64+
&& curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \
65+
&& gpg --batch --verify latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
66+
# - Unpack the toolchain, set libs permissions, and clean up.
67+
&& tar -xzf latest_toolchain.tar.gz --directory / --strip-components=1 \
68+
&& chmod -R o+r /usr/lib/swift \
69+
&& rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
70+
&& apt-get purge --auto-remove -y curl
71+
72+
# Print Installed Swift Version
73+
RUN swift --version
74+
75+
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
76+
>> /etc/bash.bashrc; \
77+
echo " ################################################################\n" \
78+
"#\t\t\t\t\t\t\t\t#\n" \
79+
"# Swift Nightly Docker Image\t\t\t\t\t#\n" \
80+
"# Tag: $(cat .swift_tag)\t\t\t#\n" \
81+
"#\t\t\t\t\t\t\t\t#\n" \
82+
"################################################################\n" > /etc/motd
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
FROM ubuntu:22.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+
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+
# gpg --keyid-format LONG -k FAF6989E1BC16FEA
15+
# pub rsa4096/FAF6989E1BC16FEA 2019-11-07 [SC] [expires: 2021-11-06]
16+
# 8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
17+
# uid [ unknown] Swift Automatic Signing Key #3 <[email protected]>
18+
ARG SWIFT_SIGNING_KEY=8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
19+
ARG SWIFT_PLATFORM=ubuntu
20+
ARG OS_MAJOR_VER=22
21+
ARG OS_MIN_VER=04
22+
ARG SWIFT_WEBROOT=https://download.swift.org/development
23+
24+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
25+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
26+
OS_MAJOR_VER=$OS_MAJOR_VER \
27+
OS_MIN_VER=$OS_MIN_VER \
28+
OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER.$OS_MIN_VER \
29+
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MIN_VER"
30+
31+
RUN set -e; \
32+
# - Grab curl and gpg here so we cache better up above
33+
export DEBIAN_FRONTEND=noninteractive \
34+
&& apt-get -q update && apt-get -q install -y curl gnupg && rm -rf /var/lib/apt/lists/* \
35+
# - Latest Toolchain info
36+
&& export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \
37+
&& export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \
38+
&& export DOWNLOAD_DIR=$(echo $download | sed "s/-${OS_VER}.tar.gz//g") \
39+
&& echo $DOWNLOAD_DIR > .swift_tag \
40+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
41+
&& export GNUPGHOME="$(mktemp -d)" \
42+
&& curl -fsSL ${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \
43+
${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \
44+
&& curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \
45+
&& gpg --batch --verify latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
46+
# - Unpack the toolchain, set libs permissions, and clean up.
47+
&& tar -xzf latest_toolchain.tar.gz --directory / --strip-components=1 ${DOWNLOAD_DIR}-${OS_VER}/usr/lib/swift/linux \
48+
&& chmod -R o+r /usr/lib/swift \
49+
&& rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
50+
&& apt-get purge --auto-remove -y curl gnupg
51+
52+
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
53+
>> /etc/bash.bashrc; \
54+
echo " ################################################################\n" \
55+
"#\t\t\t\t\t\t\t\t#\n" \
56+
"# Swift Nightly Docker Image\t\t\t\t\t#\n" \
57+
"# Tag: $(cat .swift_tag)\t\t\t#\n" \
58+
"#\t\t\t\t\t\t\t\t#\n" \
59+
"################################################################\n" > /etc/motd

0 commit comments

Comments
 (0)