Skip to content

Commit bcaa665

Browse files
authored
Merge pull request #175 from apple/swift-5.2-linux-docker
[5.2] Add Dockerfile for Ubuntu 20.04, CentOS 8, and Amazon Linux 2. …
2 parents 48e7f3d + d2e48da commit bcaa665

File tree

8 files changed

+225
-8
lines changed

8 files changed

+225
-8
lines changed

5.2/amazonlinux/2/Dockerfile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
FROM amazonlinux:2
2+
LABEL maintainer="Swift Infrastructure <swift-infrastructure@swift.org>"
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+
# pub 4096R/ED3D1561 2019-03-22 [expires: 2021-03-21]
26+
# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561
27+
# uid Swift 5.x Release Signing Key <swift-infrastructure@swift.org
28+
ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
29+
ARG SWIFT_PLATFORM=amazonlinux2
30+
ARG SWIFT_BRANCH=swift-5.2.4-release
31+
ARG SWIFT_VERSION=swift-5.2.4-RELEASE
32+
ARG SWIFT_WEBROOT=https://swift.org/builds/
33+
34+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
35+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
36+
SWIFT_BRANCH=$SWIFT_BRANCH \
37+
SWIFT_VERSION=$SWIFT_VERSION \
38+
SWIFT_WEBROOT=$SWIFT_WEBROOT
39+
40+
41+
RUN set -e; \
42+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)/" \
43+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz" \
44+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
45+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
46+
&& export GNUPGHOME="$(mktemp -d)" \
47+
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
48+
&& gpg --batch --quiet --keyserver ha.pool.sks-keyservers.net --recv-keys "$SWIFT_SIGNING_KEY" \
49+
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
50+
# - Unpack the toolchain, set libs permissions, and clean up.
51+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 \
52+
&& chmod -R o+r /usr/lib/swift \
53+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz
54+
55+
# Print Installed Swift Version
56+
RUN swift --version

5.2/centos/8/Dockerfile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
FROM centos:8
2+
LABEL maintainer="Swift Infrastructure <swift-infrastructure@swift.org>"
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+
# pub 4096R/ED3D1561 2019-03-22 [expires: 2021-03-21]
27+
# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561
28+
# uid Swift 5.x Release Signing Key <swift-infrastructure@swift.org
29+
ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
30+
ARG SWIFT_PLATFORM=centos8
31+
ARG SWIFT_BRANCH=swift-5.2.4-release
32+
ARG SWIFT_VERSION=swift-5.2.4-RELEASE
33+
ARG SWIFT_WEBROOT=https://swift.org/builds/
34+
35+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
36+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
37+
SWIFT_BRANCH=$SWIFT_BRANCH \
38+
SWIFT_VERSION=$SWIFT_VERSION \
39+
SWIFT_WEBROOT=$SWIFT_WEBROOT
40+
41+
RUN set -e; \
42+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)/" \
43+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz" \
44+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
45+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
46+
&& export GNUPGHOME="$(mktemp -d)" \
47+
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
48+
&& gpg --batch --quiet --keyserver ha.pool.sks-keyservers.net --recv-keys "$SWIFT_SIGNING_KEY" \
49+
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
50+
# - Unpack the toolchain, set libs permissions, and clean up.
51+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 \
52+
&& chmod -R o+r /usr/lib/swift \
53+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz
54+
55+
# Print Installed Swift Version
56+
RUN swift --version

5.2/ubuntu/16.04/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && ap
2727
# uid Swift 5.x Release Signing Key <swift-infrastructure@swift.org
2828
ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
2929
ARG SWIFT_PLATFORM=ubuntu16.04
30-
ARG SWIFT_BRANCH=swift-5.2.3-release
31-
ARG SWIFT_VERSION=swift-5.2.3-RELEASE
30+
ARG SWIFT_BRANCH=swift-5.2.4-release
31+
ARG SWIFT_VERSION=swift-5.2.4-RELEASE
3232
ARG SWIFT_WEBROOT=https://swift.org/builds/
3333

3434
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \

5.2/ubuntu/16.04/slim/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && ap
1717
# uid Swift 5.x Release Signing Key <swift-infrastructure@swift.org
1818
ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
1919
ARG SWIFT_PLATFORM=ubuntu16.04
20-
ARG SWIFT_BRANCH=swift-5.2.3-release
21-
ARG SWIFT_VERSION=swift-5.2.3-RELEASE
20+
ARG SWIFT_BRANCH=swift-5.2.4-release
21+
ARG SWIFT_VERSION=swift-5.2.4-RELEASE
2222
ARG SWIFT_WEBROOT=https://swift.org/builds/
2323

2424
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \

5.2/ubuntu/18.04/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && ap
2727
# uid Swift 5.x Release Signing Key <swift-infrastructure@swift.org
2828
ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
2929
ARG SWIFT_PLATFORM=ubuntu18.04
30-
ARG SWIFT_BRANCH=swift-5.2.3-release
31-
ARG SWIFT_VERSION=swift-5.2.3-RELEASE
30+
ARG SWIFT_BRANCH=swift-5.2.4-release
31+
ARG SWIFT_VERSION=swift-5.2.4-RELEASE
3232
ARG SWIFT_WEBROOT=https://swift.org/builds/
3333

3434
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \

5.2/ubuntu/18.04/slim/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && ap
1717
# uid Swift 5.x Release Signing Key <swift-infrastructure@swift.org
1818
ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
1919
ARG SWIFT_PLATFORM=ubuntu18.04
20-
ARG SWIFT_BRANCH=swift-5.2.3-release
21-
ARG SWIFT_VERSION=swift-5.2.3-RELEASE
20+
ARG SWIFT_BRANCH=swift-5.2.4-release
21+
ARG SWIFT_VERSION=swift-5.2.4-RELEASE
2222
ARG SWIFT_WEBROOT=https://swift.org/builds/
2323

2424
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \

5.2/ubuntu/20.04/Dockerfile

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
FROM ubuntu:20.04
2+
LABEL maintainer="Swift Infrastructure <swift-infrastructure@swift.org>"
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+
# pub 4096R/ED3D1561 2019-03-22 [expires: 2021-03-21]
27+
# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561
28+
# uid Swift 5.x Release Signing Key <swift-infrastructure@swift.org
29+
ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
30+
ARG SWIFT_PLATFORM=ubuntu20.04
31+
ARG SWIFT_BRANCH=swift-5.2.4-release
32+
ARG SWIFT_VERSION=swift-5.2.4-RELEASE
33+
ARG SWIFT_WEBROOT=https://swift.org/builds/
34+
35+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
36+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
37+
SWIFT_BRANCH=$SWIFT_BRANCH \
38+
SWIFT_VERSION=$SWIFT_VERSION \
39+
SWIFT_WEBROOT=$SWIFT_WEBROOT
40+
41+
RUN set -e; \
42+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)/" \
43+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz" \
44+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
45+
# - Grab curl here so we cache better up above
46+
&& export DEBIAN_FRONTEND=noninteractive \
47+
&& apt-get -q update && apt-get -q install -y curl && rm -rf /var/lib/apt/lists/* \
48+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
49+
&& export GNUPGHOME="$(mktemp -d)" \
50+
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
51+
&& gpg --batch --quiet --keyserver ha.pool.sks-keyservers.net --recv-keys "$SWIFT_SIGNING_KEY" \
52+
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
53+
# - Unpack the toolchain, set libs permissions, and clean up.
54+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 \
55+
&& chmod -R o+r /usr/lib/swift \
56+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \
57+
&& apt-get purge --auto-remove -y curl
58+
59+
# Print Installed Swift Version
60+
RUN swift --version

5.2/ubuntu/20.04/slim/Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
FROM ubuntu:20.04
2+
LABEL maintainer="Swift Infrastructure <swift-infrastructure@swift.org>"
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+
# pub 4096R/ED3D1561 2019-03-22 [expires: 2021-03-21]
15+
# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561
16+
# uid Swift 5.x Release Signing Key <swift-infrastructure@swift.org
17+
ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
18+
ARG SWIFT_PLATFORM=ubuntu20.04
19+
ARG SWIFT_BRANCH=swift-5.2.4-release
20+
ARG SWIFT_VERSION=swift-5.2.4-RELEASE
21+
ARG SWIFT_WEBROOT=https://swift.org/builds/
22+
23+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
24+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
25+
SWIFT_BRANCH=$SWIFT_BRANCH \
26+
SWIFT_VERSION=$SWIFT_VERSION \
27+
SWIFT_WEBROOT=$SWIFT_WEBROOT
28+
29+
RUN set -e; \
30+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)/" \
31+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz" \
32+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
33+
# - Grab curl and gpg here so we cache better up above
34+
&& export DEBIAN_FRONTEND=noninteractive \
35+
&& apt-get -q update && apt-get -q install -y curl gnupg && rm -rf /var/lib/apt/lists/* \
36+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
37+
&& export GNUPGHOME="$(mktemp -d)" \
38+
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
39+
&& gpg --batch --quiet --keyserver ha.pool.sks-keyservers.net --recv-keys "$SWIFT_SIGNING_KEY" \
40+
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
41+
# - Unpack the toolchain, set libs permissions, and clean up.
42+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 $SWIFT_VERSION-$SWIFT_PLATFORM/usr/lib/swift/linux \
43+
&& chmod -R o+r /usr/lib/swift \
44+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \
45+
&& apt-get purge --auto-remove -y curl gnupg

0 commit comments

Comments
 (0)