Skip to content

Commit 01bc0e2

Browse files
authored
Add Swift 6.1 nightly Dockerfiles (#433)
1 parent f44060c commit 01bc0e2

File tree

17 files changed

+1307
-0
lines changed

17 files changed

+1307
-0
lines changed

nightly-6.1/.DS_Store

6 KB
Binary file not shown.

nightly-6.1/amazonlinux/2/Dockerfile

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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-devel \
13+
libedit \
14+
libicu \
15+
libsqlite \
16+
libstdc++-static \
17+
libuuid \
18+
libxml2-devel \
19+
openssl-devel \
20+
python3-libs \
21+
tar \
22+
tzdata \
23+
unzip \
24+
zip \
25+
zlib-devel
26+
27+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
28+
29+
# gpg --keyid-format LONG -k F167DF1ACF9CE069
30+
# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2025-11-09]
31+
# E813C892820A6FA13755B268F167DF1ACF9CE069
32+
# uid [ unknown] Swift Automatic Signing Key #4 <[email protected]>
33+
ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069
34+
ARG SWIFT_PLATFORM=amazonlinux
35+
ARG OS_MAJOR_VER=2
36+
ARG SWIFT_WEBROOT=https://download.swift.org/swift-6.1-branch
37+
38+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
39+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
40+
OS_MAJOR_VER=$OS_MAJOR_VER \
41+
OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER \
42+
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER"
43+
44+
RUN echo "${SWIFT_WEBROOT}/latest-build.yml"
45+
46+
RUN set -e; \
47+
# - Latest Toolchain info
48+
export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \
49+
&& export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \
50+
&& export DOWNLOAD_DIR=$(echo $download | sed "s/-${OS_VER}.tar.gz//g") \
51+
&& echo $DOWNLOAD_DIR > .swift_tag \
52+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
53+
&& export GNUPGHOME="$(mktemp -d)" \
54+
&& curl -fsSL ${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \
55+
${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \
56+
&& curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \
57+
&& gpg --batch --verify latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
58+
# - Unpack the toolchain, set libs permissions, and clean up.
59+
&& tar -xzf latest_toolchain.tar.gz --directory / --strip-components=1 \
60+
&& chmod -R o+r /usr/lib/swift \
61+
&& rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
62+
63+
# Print Installed Swift Version
64+
RUN swift --version
65+
66+
RUN echo "[ -n \"\${TERM:-}\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bashrc; \
67+
( \
68+
printf "################################################################\n"; \
69+
printf "# %-60s #\n" ""; \
70+
printf "# %-60s #\n" "Swift Nightly Docker Image"; \
71+
printf "# %-60s #\n" "Tag: $(cat .swift_tag)"; \
72+
printf "# %-60s #\n" ""; \
73+
printf "################################################################\n" \
74+
) > /etc/motd
75+
76+
RUN echo 'source /etc/bashrc' >> /root/.bashrc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
FROM amazonlinux:2 AS base
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-devel \
13+
libedit \
14+
libicu \
15+
libsqlite \
16+
libstdc++-static \
17+
libuuid \
18+
libxml2-devel \
19+
openssl-devel \
20+
tar \
21+
tzdata \
22+
unzip \
23+
zip \
24+
zlib-devel
25+
26+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
27+
28+
# gpg --keyid-format LONG -k F167DF1ACF9CE069
29+
# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2025-11-09]
30+
# E813C892820A6FA13755B268F167DF1ACF9CE069
31+
# uid [ unknown] Swift Automatic Signing Key #4 <[email protected]>
32+
ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069
33+
ARG SWIFT_PLATFORM=amazonlinux
34+
ARG OS_MAJOR_VER=2
35+
ARG SWIFT_WEBROOT=https://download.swift.org/swift-6.1-branch
36+
37+
# This is a small trick to enable if/else for arm64 and amd64.
38+
# Because of https://bugs.swift.org/browse/SR-14872 we need adjust tar options.
39+
FROM base AS base-amd64
40+
ARG OS_ARCH_SUFFIX=
41+
42+
FROM base AS base-arm64
43+
ARG OS_ARCH_SUFFIX=-aarch64
44+
45+
FROM base-$TARGETARCH AS final
46+
47+
ARG OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER$OS_ARCH_SUFFIX
48+
ARG PLATFORM_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_ARCH_SUFFIX"
49+
50+
RUN echo "${PLATFORM_WEBROOT}/latest-build.yml"
51+
52+
RUN set -e; \
53+
# - Latest Toolchain info
54+
export $(curl -s ${PLATFORM_WEBROOT}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \
55+
&& export $(curl -s ${PLATFORM_WEBROOT}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \
56+
&& export DOWNLOAD_DIR=$(echo $download | sed "s/-${OS_VER}.tar.gz//g") \
57+
&& echo $DOWNLOAD_DIR > .swift_tag \
58+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
59+
&& export GNUPGHOME="$(mktemp -d)" \
60+
&& curl -fsSL ${PLATFORM_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \
61+
${PLATFORM_WEBROOT}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \
62+
&& curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \
63+
&& gpg --batch --verify latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
64+
# - Unpack the toolchain, set libs permissions, and clean up.
65+
&& tar -xzf latest_toolchain.tar.gz --directory / --strip-components=1 \
66+
&& chmod -R o+r /usr/lib/swift \
67+
&& rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
68+
69+
# Print Installed Swift Version
70+
RUN swift --version
71+
72+
RUN echo "[ -n \"\${TERM:-}\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bashrc; \
73+
( \
74+
printf "################################################################\n"; \
75+
printf "# %-60s #\n" ""; \
76+
printf "# %-60s #\n" "Swift Nightly Docker Image"; \
77+
printf "# %-60s #\n" "Tag: $(cat .swift_tag)"; \
78+
printf "# %-60s #\n" ""; \
79+
printf "################################################################\n" \
80+
) > /etc/motd
81+
82+
RUN echo 'source /etc/bashrc' >> /root/.bashrc
+55
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+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
6+
7+
# gpg --keyid-format LONG -k F167DF1ACF9CE069
8+
# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2025-11-09]
9+
# E813C892820A6FA13755B268F167DF1ACF9CE069
10+
# uid [ unknown] Swift Automatic Signing Key #4 <[email protected]>
11+
ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069
12+
ARG SWIFT_PLATFORM=amazonlinux
13+
ARG OS_MAJOR_VER=2
14+
ARG SWIFT_WEBROOT=https://download.swift.org/swift-6.1-branch
15+
16+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
17+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
18+
OS_MAJOR_VER=$OS_MAJOR_VER \
19+
OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER \
20+
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER"
21+
22+
RUN echo "${SWIFT_WEBROOT}/latest-build.yml"
23+
24+
RUN set -e; \
25+
# - Latest Toolchain info
26+
export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \
27+
&& export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \
28+
&& export DOWNLOAD_DIR=$(echo $download | sed "s/-${OS_VER}.tar.gz//g") \
29+
&& echo $DOWNLOAD_DIR > .swift_tag \
30+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
31+
&& export GNUPGHOME="$(mktemp -d)" \
32+
&& curl -fsSL ${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \
33+
${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \
34+
&& curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \
35+
&& gpg --batch --verify latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
36+
# - Unpack the toolchain, set libs permissions, and clean up.
37+
&& yum -y install tar gzip \
38+
&& tar -xzf latest_toolchain.tar.gz --directory / --strip-components=1 \
39+
${DOWNLOAD_DIR}-${OS_VER}/usr/lib/swift/linux \
40+
${DOWNLOAD_DIR}-${OS_VER}/usr/libexec/swift/linux \
41+
&& chmod -R o+r /usr/lib/swift /usr/libexec/swift \
42+
&& rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
43+
&& yum autoremove -y tar gzip
44+
45+
RUN echo "[ -n \"\${TERM:-}\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bashrc; \
46+
( \
47+
printf "################################################################\n"; \
48+
printf "# %-60s #\n" ""; \
49+
printf "# %-60s #\n" "Swift Nightly Docker Image"; \
50+
printf "# %-60s #\n" "Tag: $(cat .swift_tag)"; \
51+
printf "# %-60s #\n" ""; \
52+
printf "################################################################\n" \
53+
) > /etc/motd
54+
55+
RUN echo 'source /etc/bashrc' >> /root/.bashrc

nightly-6.1/centos/7/Dockerfile

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
FROM centos:7
2+
LABEL maintainer="Swift Infrastructure <[email protected]>"
3+
LABEL description="Docker Container for the Swift programming language"
4+
5+
# CentOS 7 ships with git 1.x which is too old for the toolchain usage, using RH software collections to install git 2.x
6+
RUN yum install -y centos-release-scl-rh
7+
8+
RUN yum install shadow-utils.x86_64 -y \
9+
binutils \
10+
gcc \
11+
rh-git227-git \
12+
glibc-static \
13+
libbsd-devel \
14+
libcurl-devel \
15+
libedit \
16+
libedit-devel \
17+
libicu-devel \
18+
libstdc++-static \
19+
libxml2-devel \
20+
pkg-config \
21+
python2 \
22+
python3 \
23+
sqlite \
24+
unzip \
25+
zip \
26+
zlib-devel
27+
28+
# Enable git 2.x from RH software collections for both login and non-login shells
29+
RUN ln -s /opt/rh/rh-git227/enable /etc/profile.d/git.sh
30+
ENV ENV=/etc/profile.d/git.sh
31+
ENV BASH_ENV=$ENV
32+
33+
RUN sed -i -e 's/\*__block/\*__libc_block/g' /usr/include/unistd.h
34+
35+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
36+
37+
# gpg --keyid-format LONG -k F167DF1ACF9CE069
38+
# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2025-11-09]
39+
# E813C892820A6FA13755B268F167DF1ACF9CE069
40+
# uid [ unknown] Swift Automatic Signing Key #4 <[email protected]>
41+
ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069
42+
ARG SWIFT_PLATFORM=centos
43+
ARG OS_MAJOR_VER=7
44+
ARG SWIFT_WEBROOT=https://download.swift.org/swift-6.1-branch
45+
46+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
47+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
48+
OS_MAJOR_VER=$OS_MAJOR_VER \
49+
OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER \
50+
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER"
51+
52+
RUN echo "${SWIFT_WEBROOT}/latest-build.yml"
53+
54+
RUN set -e; \
55+
# - Latest Toolchain info
56+
export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \
57+
&& export $(curl -s ${SWIFT_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 -fL ${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \
63+
${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \
64+
&& curl -fL 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+
71+
# The devtoolset-8 that the Swift runtime is built against uses new
72+
# functionality in the backdeploy `libstdc++_noshared.a` in devtoolset-a.
73+
# A linkerscript in the devtoolset ensures that it is picked up appropriately.
74+
# When dynamically linking the runtime, this static archive is merged into the
75+
# shared object. When static linking, the compat library needs to be available
76+
# to be merged into the final shared object/executable.
77+
#
78+
# Symlink it from the devtoolset into the static swift resource directory
79+
RUN yum install -y centos-release-scl
80+
RUN yum install -y devtoolset-8
81+
RUN ln -s /opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8/libstdc++_nonshared.a /usr/lib/swift_static/linux && \
82+
ln -s /opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8/libstdc++.so /usr/lib/swift_static/linux
83+
84+
# Print Installed Swift Version
85+
RUN swift --version
86+
87+
RUN echo "[ -n \"\${TERM:-}\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bashrc; \
88+
( \
89+
printf "################################################################\n"; \
90+
printf "# %-60s #\n" ""; \
91+
printf "# %-60s #\n" "Swift Nightly Docker Image"; \
92+
printf "# %-60s #\n" "Tag: $(cat .swift_tag)"; \
93+
printf "# %-60s #\n" ""; \
94+
printf "################################################################\n" \
95+
) > /etc/motd

nightly-6.1/centos/7/slim/Dockerfile

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
# gpg --keyid-format LONG -k F167DF1ACF9CE069
8+
# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2025-11-09]
9+
# E813C892820A6FA13755B268F167DF1ACF9CE069
10+
# uid [ unknown] Swift Automatic Signing Key #4 <[email protected]>
11+
ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069
12+
ARG SWIFT_PLATFORM=centos
13+
ARG OS_MAJOR_VER=7
14+
ARG SWIFT_WEBROOT=https://download.swift.org/swift-6.1-branch
15+
16+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
17+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
18+
OS_MAJOR_VER=$OS_MAJOR_VER \
19+
OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER \
20+
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER"
21+
22+
RUN echo "${SWIFT_WEBROOT}/latest-build.yml"
23+
24+
RUN set -e; \
25+
# - Latest Toolchain info
26+
export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \
27+
&& export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \
28+
&& export DOWNLOAD_DIR=$(echo $download | sed "s/-${OS_VER}.tar.gz//g") \
29+
&& echo $DOWNLOAD_DIR > .swift_tag \
30+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
31+
&& export GNUPGHOME="$(mktemp -d)" \
32+
&& curl -fsSL ${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \
33+
${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \
34+
&& curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \
35+
&& gpg --batch --verify latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
36+
# - Unpack the toolchain, set libs permissions, and clean up.
37+
&& tar -xzf latest_toolchain.tar.gz --directory / --strip-components=1 \
38+
${DOWNLOAD_DIR}-${OS_VER}/usr/lib/swift/linux \
39+
${DOWNLOAD_DIR}-${OS_VER}/usr/libexec/swift/linux \
40+
&& chmod -R o+r /usr/lib/swift /usr/libexec/swift \
41+
&& rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz
42+
43+
RUN echo "[ -n \"\${TERM:-}\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bashrc; \
44+
( \
45+
printf "################################################################\n"; \
46+
printf "# %-60s #\n" ""; \
47+
printf "# %-60s #\n" "Swift Nightly Docker Image"; \
48+
printf "# %-60s #\n" "Tag: $(cat .swift_tag)"; \
49+
printf "# %-60s #\n" ""; \
50+
printf "################################################################\n" \
51+
) > /etc/motd

0 commit comments

Comments
 (0)