Skip to content

Commit 914ba19

Browse files
committed
Swift 5.3 CentOS 7 Dockerfile
1 parent 692d9d1 commit 914ba19

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed

5.3/centos/7/Dockerfile

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
glibc-static \
10+
libbsd-devel \
11+
libedit \
12+
libedit-devel \
13+
libicu-devel \
14+
libstdc++-static \
15+
pkg-config \
16+
python2 \
17+
sqlite \
18+
zlib-devel
19+
20+
RUN sed -i -e 's/\*__block/\*__libc_block/g' /usr/include/unistd.h
21+
22+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
23+
24+
# pub 4096R/ED3D1561 2019-03-22 [expires: 2021-03-21]
25+
# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561
26+
# uid Swift 5.x Release Signing Key <[email protected]
27+
ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
28+
ARG SWIFT_PLATFORM=centos7
29+
ARG SWIFT_BRANCH=swift-5.3-release
30+
ARG SWIFT_VERSION=swift-5.3-RELEASE
31+
ARG SWIFT_WEBROOT=https://swift.org/builds/
32+
33+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
34+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
35+
SWIFT_BRANCH=$SWIFT_BRANCH \
36+
SWIFT_VERSION=$SWIFT_VERSION \
37+
SWIFT_WEBROOT=$SWIFT_WEBROOT
38+
39+
RUN set -e; \
40+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)/" \
41+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz" \
42+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
43+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
44+
&& export GNUPGHOME="$(mktemp -d)" \
45+
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
46+
&& gpg --batch --quiet --keyserver ha.pool.sks-keyservers.net --recv-keys "$SWIFT_SIGNING_KEY" \
47+
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
48+
# - Unpack the toolchain, set libs permissions, and clean up.
49+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 \
50+
&& chmod -R o+r /usr/lib/swift \
51+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz
52+
53+
# Print Installed Swift Version
54+
RUN swift --version

5.3/centos/7/slim/Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
# pub 4096R/ED3D1561 2019-03-22 [expires: 2021-03-21]
8+
# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561
9+
# uid Swift 5.x Release Signing Key <[email protected]
10+
ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
11+
ARG SWIFT_PLATFORM=centos7
12+
ARG SWIFT_BRANCH=swift-5.3-release
13+
ARG SWIFT_VERSION=swift-5.3-RELEASE
14+
ARG SWIFT_WEBROOT=https://swift.org/builds/
15+
16+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
17+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
18+
SWIFT_BRANCH=$SWIFT_BRANCH \
19+
SWIFT_VERSION=$SWIFT_VERSION \
20+
SWIFT_WEBROOT=$SWIFT_WEBROOT
21+
22+
RUN set -e; \
23+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)/" \
24+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz" \
25+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
26+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
27+
&& export GNUPGHOME="$(mktemp -d)" \
28+
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
29+
&& gpg --batch --quiet --keyserver ha.pool.sks-keyservers.net --recv-keys "$SWIFT_SIGNING_KEY" \
30+
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
31+
# - Unpack the toolchain, set libs permissions, and clean up.
32+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 $SWIFT_VERSION-$SWIFT_PLATFORM/usr/lib/swift/linux \
33+
&& chmod -R o+r /usr/lib/swift \
34+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz

0 commit comments

Comments
 (0)