Skip to content

Commit 7779f0f

Browse files
authored
[5.8] Add nightly Dockerfiles (#321)
1 parent 59e3cc2 commit 7779f0f

File tree

13 files changed

+893
-0
lines changed

13 files changed

+893
-0
lines changed

nightly-5.8/amazonlinux/2/Dockerfile

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

nightly-5.8/centos/7/Dockerfile

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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+
unzip \
10+
glibc-static \
11+
libbsd-devel \
12+
libcurl-devel \
13+
libedit \
14+
libedit-devel \
15+
libicu-devel \
16+
libstdc++-static \
17+
libxml2-devel \
18+
pkg-config \
19+
python2 \
20+
python3 \
21+
sqlite \
22+
zlib-devel
23+
24+
RUN sed -i -e 's/\*__block/\*__libc_block/g' /usr/include/unistd.h
25+
26+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
27+
28+
# gpg --keyid-format LONG -k FAF6989E1BC16FEA
29+
# pub rsa4096/FAF6989E1BC16FEA 2019-11-07 [SC] [expires: 2021-11-06]
30+
# 8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
31+
# uid [ unknown] Swift Automatic Signing Key #3 <[email protected]>
32+
ARG SWIFT_SIGNING_KEY=8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
33+
ARG SWIFT_PLATFORM=centos
34+
ARG OS_MAJOR_VER=7
35+
ARG SWIFT_WEBROOT=https://download.swift.org/swift-5.8-branch
36+
37+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
38+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
39+
OS_MAJOR_VER=$OS_MAJOR_VER \
40+
OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER \
41+
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER"
42+
43+
RUN echo "${SWIFT_WEBROOT}/latest-build.yml"
44+
45+
RUN set -e; \
46+
# - Latest Toolchain info
47+
export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \
48+
&& export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \
49+
&& export DOWNLOAD_DIR=$(echo $download | sed "s/-${OS_VER}.tar.gz//g") \
50+
&& echo $DOWNLOAD_DIR > .swift_tag \
51+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
52+
&& export GNUPGHOME="$(mktemp -d)" \
53+
&& curl -fL ${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \
54+
${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \
55+
&& curl -fL https://swift.org/keys/all-keys.asc | gpg --import - \
56+
&& gpg --batch --verify latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
57+
# - Unpack the toolchain, set libs permissions, and clean up.
58+
&& tar -xzf latest_toolchain.tar.gz --directory / --strip-components=1 \
59+
&& chmod -R o+r /usr/lib/swift \
60+
&& rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz
61+
62+
# Print Installed Swift Version
63+
RUN swift --version
64+
65+
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
66+
>> /etc/bashrc; \
67+
echo -e " ################################################################\n" \
68+
"#\t\t\t\t\t\t\t\t#\n" \
69+
"# Swift Nightly Docker Image\t\t\t\t\t#\n" \
70+
"# Tag: $(cat .swift_tag)\t\t\t#\n" \
71+
"#\t\t\t\t\t\t\t\t#\n" \
72+
"################################################################\n" > /etc/motd

nightly-5.8/centos/7/slim/Dockerfile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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 FAF6989E1BC16FEA
8+
# pub rsa4096/FAF6989E1BC16FEA 2019-11-07 [SC] [expires: 2021-11-06]
9+
# 8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
10+
# uid [ unknown] Swift Automatic Signing Key #3 <[email protected]>
11+
ARG SWIFT_SIGNING_KEY=8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
12+
ARG SWIFT_PLATFORM=centos
13+
ARG OS_MAJOR_VER=7
14+
ARG SWIFT_WEBROOT=https://download.swift.org/swift-5.8-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 ${DOWNLOAD_DIR}-${OS_VER}/usr/lib/swift/linux \
38+
&& chmod -R o+r /usr/lib/swift \
39+
&& rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz
40+
41+
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
42+
>> /etc/bashrc; \
43+
echo -e " ################################################################\n" \
44+
"#\t\t\t\t\t\t\t\t#\n" \
45+
"# Swift Nightly Docker Image\t\t\t\t\t#\n" \
46+
"# Tag: $(cat .swift_tag)\t\t\t#\n" \
47+
"#\t\t\t\t\t\t\t\t#\n" \
48+
"################################################################\n" > /etc/motd

0 commit comments

Comments
 (0)