Skip to content

Commit 09e8516

Browse files
committed
Add Dockerfiles for nightly builds for 5.2 and 5.3 using Ubuntu Focal, CentOS 8, AmazonLinux 2
1 parent bcaa665 commit 09e8516

File tree

8 files changed

+548
-0
lines changed

8 files changed

+548
-0
lines changed

nightly-5.2/amazonlinux/2/Dockerfile

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

nightly-5.2/centos/8/Dockerfile

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
FROM centos:8
2+
LABEL maintainer="Swift Infrastructure <[email protected]>"
3+
LABEL description="Docker Container for the Swift programming language"
4+
5+
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
6+
7+
RUN yum -y update && yum install --enablerepo=PowerTools -y \
8+
binutils \
9+
gcc \
10+
git \
11+
glibc-static \
12+
libbsd-devel \
13+
libedit \
14+
libedit-devel \
15+
libicu-devel \
16+
libstdc++-static \
17+
pkg-config \
18+
python2 \
19+
sqlite \
20+
zlib-devel
21+
22+
RUN ln -s /usr/bin/python2 /usr/bin/python
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=centos
32+
ARG OS_MAJOR_VER=8
33+
ARG SWIFT_WEBROOT=https://swift.org/builds/swift-5.2-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

nightly-5.2/ubuntu/20.04/Dockerfile

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
FROM ubuntu:20.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 \
12+
libedit2 \
13+
libgcc-9-dev \
14+
libpython2.7 \
15+
libsqlite3-0 \
16+
libstdc++-9-dev \
17+
libxml2 \
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=20
33+
ARG OS_MIN_VER=04
34+
ARG SWIFT_WEBROOT=https://swift.org/builds/swift-5.2-branch
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 set -e; \
44+
# - Grab curl here so we cache better up above
45+
export DEBIAN_FRONTEND=noninteractive \
46+
&& apt-get -q update && apt-get -q install -y curl && rm -rf /var/lib/apt/lists/* \
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+
&& apt-get purge --auto-remove -y curl
63+
64+
# Print Installed Swift Version
65+
RUN swift --version
66+
67+
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
68+
>> /etc/bash.bashrc; \
69+
echo " ################################################################\n" \
70+
"#\t\t\t\t\t\t\t\t#\n" \
71+
"# Swift Nightly Docker Image\t\t\t\t#\n" \
72+
"# Tag: $(cat .swift_tag)\t\t\t#\n" \
73+
"#\t\t\t\t\t\t\t\t#\n" \
74+
"################################################################\n" > /etc/motd
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
FROM ubuntu:20.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=20
21+
ARG OS_MIN_VER=04
22+
ARG SWIFT_WEBROOT=https://swift.org/builds/swift-5.2-branch
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#\n" \
57+
"# Tag: $(cat .swift_tag)\t\t\t#\n" \
58+
"#\t\t\t\t\t\t\t\t#\n" \
59+
"################################################################\n" > /etc/motd

nightly-5.3/amazonlinux/2/Dockerfile

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

0 commit comments

Comments
 (0)