Skip to content

Commit 0b3172c

Browse files
authored
Merge pull request #170 from apple/dependencies
refactor nightly docker files
2 parents 17a9e2f + 0932995 commit 0b3172c

File tree

8 files changed

+119
-63
lines changed

8 files changed

+119
-63
lines changed

nightly-master/amazonlinux/2/Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
3434
SWIFT_PLATFORM=$SWIFT_PLATFORM \
3535
OS_MAJOR_VER=$OS_MAJOR_VER \
3636
OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER \
37-
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER"
37+
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER"
3838

3939
RUN echo "${SWIFT_WEBROOT}/latest-build.yml"
4040

@@ -59,10 +59,12 @@ RUN set -e; \
5959
RUN swift --version
6060

6161
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
62-
>> /etc/bash.bashrc; \
63-
echo " ################################################################\n" \
62+
>> /etc/bashrc; \
63+
echo -e " ################################################################\n" \
6464
"#\t\t\t\t\t\t\t\t#\n" \
65-
"# Swift Nightly Docker Image\t\t\t\t#\n" \
65+
"# Swift Nightly Docker Image\t\t\t\t\t#\n" \
6666
"# Tag: $(cat .swift_tag)\t\t\t#\n" \
6767
"#\t\t\t\t\t\t\t\t#\n" \
6868
"################################################################\n" > /etc/motd
69+
70+
RUN echo 'source /etc/bashrc' >> /root/.bashrc

nightly-master/centos/8/Dockerfile

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@ LABEL description="Docker Container for the Swift programming language"
44

55
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
66

7-
RUN yum -y update && \
8-
yum install --enablerepo=PowerTools -y \
9-
binutils \
10-
gcc \
11-
git \
12-
glibc-static \
13-
libbsd-devel \
14-
libedit \
15-
libedit-devel \
16-
libicu-devel \
17-
libstdc++-static \
18-
pkg-config \
19-
python2 \
20-
sqlite
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
2120

2221
RUN ln -s /usr/bin/python2 /usr/bin/python
2322

@@ -36,7 +35,7 @@ ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
3635
SWIFT_PLATFORM=$SWIFT_PLATFORM \
3736
OS_MAJOR_VER=$OS_MAJOR_VER \
3837
OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER \
39-
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER"
38+
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER"
4039

4140
RUN echo "${SWIFT_WEBROOT}/latest-build.yml"
4241

@@ -61,10 +60,10 @@ RUN set -e; \
6160
RUN swift --version
6261

6362
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
64-
>> /etc/bash.bashrc; \
65-
echo " ################################################################\n" \
63+
>> /etc/bashrc; \
64+
echo -e " ################################################################\n" \
6665
"#\t\t\t\t\t\t\t\t#\n" \
67-
"# Swift Nightly Docker Image\t\t\t\t#\n" \
66+
"# Swift Nightly Docker Image\t\t\t\t\t#\n" \
6867
"# Tag: $(cat .swift_tag)\t\t\t#\n" \
6968
"#\t\t\t\t\t\t\t\t#\n" \
7069
"################################################################\n" > /etc/motd

nightly-master/ubuntu/16.04/Dockerfile

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@ LABEL description="Docker Container for the Swift programming language"
44

55
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \
66
apt-get -q install -y \
7-
libatomic1 \
7+
binutils \
8+
git \
9+
libc6-dev \
810
libcurl3 \
9-
libxml2 \
1011
libedit2 \
11-
libsqlite3-0 \
12-
libc6-dev \
13-
binutils \
1412
libgcc-5-dev \
15-
libstdc++-5-dev \
16-
zlib1g-dev \
1713
libpython2.7 \
18-
tzdata \
19-
git \
14+
libsqlite3-0 \
15+
libstdc++-5-dev \
16+
libxml2 \
2017
pkg-config \
18+
tzdata \
19+
zlib1g-dev \
2120
&& rm -r /var/lib/apt/lists/*
2221

2322
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
@@ -37,7 +36,7 @@ ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
3736
OS_MAJOR_VER=$OS_MAJOR_VER \
3837
OS_MIN_VER=$OS_MIN_VER \
3938
OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER.$OS_MIN_VER \
40-
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MIN_VER"
39+
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MIN_VER"
4140

4241
RUN set -e; \
4342
# - Grab curl here so we cache better up above
@@ -67,7 +66,7 @@ RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
6766
>> /etc/bash.bashrc; \
6867
echo " ################################################################\n" \
6968
"#\t\t\t\t\t\t\t\t#\n" \
70-
"# Swift Nightly Docker Image\t\t\t\t#\n" \
69+
"# Swift Nightly Docker Image\t\t\t\t\t#\n" \
7170
"# Tag: $(cat .swift_tag)\t\t\t#\n" \
7271
"#\t\t\t\t\t\t\t\t#\n" \
7372
"################################################################\n" > /etc/motd

nightly-master/ubuntu/16.04/slim/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ LABEL description="Docker Container for the Swift programming language"
44

55
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \
66
apt-get -q install -y \
7-
libatomic1 \
87
libcurl3 \
98
libxml2 \
109
tzdata \
@@ -27,7 +26,7 @@ ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
2726
OS_MAJOR_VER=$OS_MAJOR_VER \
2827
OS_MIN_VER=$OS_MIN_VER \
2928
OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER.$OS_MIN_VER \
30-
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MIN_VER"
29+
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MIN_VER"
3130

3231
RUN set -e; \
3332
# - Grab curl and gpg here so we cache better up above
@@ -54,7 +53,7 @@ RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
5453
>> /etc/bash.bashrc; \
5554
echo " ################################################################\n" \
5655
"#\t\t\t\t\t\t\t\t#\n" \
57-
"# Swift Nightly Docker Image\t\t\t\t#\n" \
56+
"# Swift Nightly Docker Image\t\t\t\t\t#\n" \
5857
"# Tag: $(cat .swift_tag)\t\t\t#\n" \
5958
"#\t\t\t\t\t\t\t\t#\n" \
60-
"################################################################\n" > /etc/motd
59+
"################################################################\n" > /etc/motd

nightly-master/ubuntu/18.04/Dockerfile

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@ LABEL description="Docker Container for the Swift programming language"
44

55
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \
66
apt-get -q install -y \
7-
libatomic1 \
7+
binutils \
8+
git \
9+
libc6-dev \
810
libcurl4 \
9-
libxml2 \
1011
libedit2 \
11-
libsqlite3-0 \
12-
libc6-dev \
13-
binutils \
1412
libgcc-5-dev \
15-
libstdc++-5-dev \
16-
zlib1g-dev \
1713
libpython2.7 \
18-
tzdata \
19-
git \
14+
libsqlite3-0 \
15+
libstdc++-5-dev \
16+
libxml2 \
2017
pkg-config \
18+
tzdata \
19+
zlib1g-dev \
2120
&& rm -r /var/lib/apt/lists/*
2221

2322
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
@@ -37,7 +36,7 @@ ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
3736
OS_MAJOR_VER=$OS_MAJOR_VER \
3837
OS_MIN_VER=$OS_MIN_VER \
3938
OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER.$OS_MIN_VER \
40-
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MIN_VER"
39+
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MIN_VER"
4140

4241
RUN set -e; \
4342
# - Grab curl here so we cache better up above
@@ -67,7 +66,7 @@ RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
6766
>> /etc/bash.bashrc; \
6867
echo " ################################################################\n" \
6968
"#\t\t\t\t\t\t\t\t#\n" \
70-
"# Swift Nightly Docker Image\t\t\t\t#\n" \
69+
"# Swift Nightly Docker Image\t\t\t\t\t#\n" \
7170
"# Tag: $(cat .swift_tag)\t\t\t#\n" \
7271
"#\t\t\t\t\t\t\t\t#\n" \
7372
"################################################################\n" > /etc/motd

nightly-master/ubuntu/18.04/slim/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ LABEL description="Docker Container for the Swift programming language"
44

55
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \
66
apt-get -q install -y \
7-
libatomic1 \
87
libcurl4 \
98
libxml2 \
109
tzdata \
@@ -27,7 +26,7 @@ ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
2726
OS_MAJOR_VER=$OS_MAJOR_VER \
2827
OS_MIN_VER=$OS_MIN_VER \
2928
OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER.$OS_MIN_VER \
30-
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MIN_VER"
29+
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MIN_VER"
3130

3231
RUN set -e; \
3332
# - Grab curl and gpg here so we cache better up above
@@ -54,7 +53,7 @@ RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
5453
>> /etc/bash.bashrc; \
5554
echo " ################################################################\n" \
5655
"#\t\t\t\t\t\t\t\t#\n" \
57-
"# Swift Nightly Docker Image\t\t\t\t#\n" \
56+
"# Swift Nightly Docker Image\t\t\t\t\t#\n" \
5857
"# Tag: $(cat .swift_tag)\t\t\t#\n" \
5958
"#\t\t\t\t\t\t\t\t#\n" \
60-
"################################################################\n" > /etc/motd
59+
"################################################################\n" > /etc/motd

nightly-master/ubuntu/20.04/Dockerfile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ LABEL description="Docker Container for the Swift programming language"
44

55
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \
66
apt-get -q install -y \
7+
binutils \
8+
git \
9+
gnupg2 \
10+
libc6-dev \
711
libcurl4 \
8-
libxml2 \
912
libedit2 \
10-
libsqlite3-0 \
11-
libc6-dev \
12-
binutils \
1313
libgcc-9-dev \
14+
libpython2.7 \
15+
libsqlite3-0 \
1416
libstdc++-9-dev \
15-
zlib1g-dev \
17+
libxml2 \
1618
libz3-dev \
17-
libpython2.7 \
18-
tzdata \
19-
git \
2019
pkg-config \
21-
gnupg2 \
20+
tzdata \
21+
zlib1g-dev \
2222
&& rm -r /var/lib/apt/lists/*
2323

2424
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
@@ -38,7 +38,7 @@ ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
3838
OS_MAJOR_VER=$OS_MAJOR_VER \
3939
OS_MIN_VER=$OS_MIN_VER \
4040
OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER.$OS_MIN_VER \
41-
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MIN_VER"
41+
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MIN_VER"
4242

4343
RUN echo "${SWIFT_WEBROOT}/latest-build.yml"
4444

@@ -70,7 +70,7 @@ RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
7070
>> /etc/bash.bashrc; \
7171
echo " ################################################################\n" \
7272
"#\t\t\t\t\t\t\t\t#\n" \
73-
"# Swift Nightly Docker Image\t\t\t\t#\n" \
73+
"# Swift Nightly Docker Image\t\t\t\t\t#\n" \
7474
"# Tag: $(cat .swift_tag)\t\t\t#\n" \
7575
"#\t\t\t\t\t\t\t\t#\n" \
7676
"################################################################\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=18
21+
ARG OS_MIN_VER=04
22+
ARG SWIFT_WEBROOT=https://swift.org/builds/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)