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
0 commit comments