Skip to content

Commit 0d3ffbb

Browse files
authored
Merge pull request #134 from apple/swift-5.0-docker
Add Swift 5.0 Dockerfiles for Ubuntu 16.04 and Ubuntu 18.04
2 parents 75dde01 + 1326789 commit 0d3ffbb

File tree

2 files changed

+108
-0
lines changed

2 files changed

+108
-0
lines changed

5.0/ubuntu/16.04/Dockerfile

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
FROM ubuntu:16.04
2+
LABEL maintainer="Swift Infrastructure <[email protected]>"
3+
LABEL Description="Docker Container for the Swift programming language"
4+
5+
# Install related packages and set LLVM 3.8 as the compiler
6+
RUN apt-get -q update && \
7+
apt-get -q install -y \
8+
make \
9+
libc6-dev \
10+
clang-3.8 \
11+
curl \
12+
libedit-dev \
13+
libpython2.7 \
14+
libicu-dev \
15+
libssl-dev \
16+
libxml2 \
17+
tzdata \
18+
git \
19+
libcurl4-openssl-dev \
20+
pkg-config \
21+
&& update-alternatives --quiet --install /usr/bin/clang clang /usr/bin/clang-3.8 100 \
22+
&& update-alternatives --quiet --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.8 100 \
23+
&& rm -r /var/lib/apt/lists/*
24+
25+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
26+
ARG SWIFT_PLATFORM=ubuntu16.04
27+
ARG SWIFT_BRANCH=swift-5.0-release
28+
ARG SWIFT_VERSION=swift-5.0-RELEASE
29+
30+
ENV SWIFT_PLATFORM=$SWIFT_PLATFORM \
31+
SWIFT_BRANCH=$SWIFT_BRANCH \
32+
SWIFT_VERSION=$SWIFT_VERSION
33+
34+
# Download GPG keys, signature and Swift package, then unpack, cleanup and execute permissions for foundation libs
35+
RUN SWIFT_URL=https://swift.org/builds/$SWIFT_BRANCH/$(echo "$SWIFT_PLATFORM" | tr -d .)/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz \
36+
&& curl -fSsL $SWIFT_URL -o swift.tar.gz \
37+
&& curl -fSsL $SWIFT_URL.sig -o swift.tar.gz.sig \
38+
&& export GNUPGHOME="$(mktemp -d)" \
39+
&& set -e; \
40+
for key in \
41+
# pub 4096R/ED3D1561 2019-03-22 [expires: 2021-03-21]
42+
# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561
43+
# uid Swift 5.x Release Signing Key <[email protected]
44+
A62AE125BBBFBB96A6E042EC925CC1CCED3D1561 \
45+
; do \
46+
gpg --quiet --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
47+
done \
48+
&& gpg --batch --verify --quiet swift.tar.gz.sig swift.tar.gz \
49+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 \
50+
&& rm -r "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \
51+
&& chmod -R o+r /usr/lib/swift
52+
53+
# Print Installed Swift Version
54+
RUN swift --version

5.0/ubuntu/18.04/Dockerfile

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
FROM ubuntu:18.04
2+
LABEL maintainer="Swift Infrastructure <[email protected]>"
3+
LABEL Description="Docker Container for the Swift programming language"
4+
5+
# Install related packages and set LLVM 3.9 as the compiler
6+
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \
7+
apt-get -q install -y \
8+
make \
9+
libc6-dev \
10+
clang-3.9 \
11+
curl \
12+
libedit-dev \
13+
libpython2.7 \
14+
libicu-dev \
15+
libssl-dev \
16+
libxml2 \
17+
tzdata \
18+
git \
19+
libcurl4-openssl-dev \
20+
pkg-config \
21+
&& update-alternatives --quiet --install /usr/bin/clang clang /usr/bin/clang-3.9 100 \
22+
&& update-alternatives --quiet --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.9 100 \
23+
&& rm -r /var/lib/apt/lists/*
24+
25+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
26+
ARG SWIFT_PLATFORM=ubuntu18.04
27+
ARG SWIFT_BRANCH=swift-5.0-release
28+
ARG SWIFT_VERSION=swift-5.0-RELEASE
29+
30+
ENV SWIFT_PLATFORM=$SWIFT_PLATFORM \
31+
SWIFT_BRANCH=$SWIFT_BRANCH \
32+
SWIFT_VERSION=$SWIFT_VERSION
33+
34+
# Download GPG keys, signature and Swift package, then unpack, cleanup and execute permissions for foundation libs
35+
RUN SWIFT_URL=https://swift.org/builds/$SWIFT_BRANCH/$(echo "$SWIFT_PLATFORM" | tr -d .)/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz \
36+
&& curl -fSsL $SWIFT_URL -o swift.tar.gz \
37+
&& curl -fSsL $SWIFT_URL.sig -o swift.tar.gz.sig \
38+
&& export GNUPGHOME="$(mktemp -d)" \
39+
&& set -e; \
40+
for key in \
41+
# pub 4096R/ED3D1561 2019-03-22 [expires: 2021-03-21]
42+
# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561
43+
# uid Swift 5.x Release Signing Key <[email protected]
44+
A62AE125BBBFBB96A6E042EC925CC1CCED3D1561 \
45+
; do \
46+
gpg --quiet --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
47+
done \
48+
&& gpg --batch --verify --quiet swift.tar.gz.sig swift.tar.gz \
49+
&& tar -xzf swift.tar.gz --directory / --strip-components=1 \
50+
&& rm -r "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \
51+
&& chmod -R o+r /usr/lib/swift
52+
53+
# Print Installed Swift Version
54+
RUN swift --version

0 commit comments

Comments
 (0)