Skip to content

Commit 4bae602

Browse files
committed
Add Dockerfiles for Ubuntu 20.04, CentOS 8, and Amazon Linux 2
1 parent 38f1793 commit 4bae602

File tree

8 files changed

+404
-0
lines changed

8 files changed

+404
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
FROM amazonlinux:2
2+
LABEL maintainer="Swift Infrastructure <[email protected]>"
3+
LABEL description="Docker Container for the Swift programming language"
4+
5+
RUN yum -y update && yum -y install \
6+
binutils \
7+
gcc \
8+
glibc-static \
9+
gzip \
10+
libbsd \
11+
libcurl \
12+
libedit \
13+
libicu \
14+
libsqlite \
15+
libstdc++-static \
16+
libuuid \
17+
libxml2 \
18+
tar \
19+
tzdata
20+
21+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
22+
23+
# gpg --keyid-format LONG -k FAF6989E1BC16FEA
24+
# pub rsa4096/FAF6989E1BC16FEA 2019-11-07 [SC] [expires: 2021-11-06]
25+
# 8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
26+
# uid [ unknown] Swift Automatic Signing Key #3 <[email protected]>
27+
ARG SWIFT_SIGNING_KEY=8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
28+
ARG SWIFT_PLATFORM=amazonlinux
29+
ARG OS_MAJOR_VER=2
30+
ARG SWIFT_WEBROOT=https://swift.org/builds/development
31+
32+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
33+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
34+
OS_MAJOR_VER=$OS_MAJOR_VER \
35+
OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER \
36+
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER"
37+
38+
RUN echo "${SWIFT_WEBROOT}/latest-build.yml"
39+
40+
RUN set -e; \
41+
# - Latest Toolchain info
42+
export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \
43+
&& export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \
44+
&& export DOWNLOAD_DIR=$(echo $download | sed "s/-${OS_VER}.tar.gz//g") \
45+
&& echo $DOWNLOAD_DIR > .swift_tag \
46+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
47+
&& export GNUPGHOME="$(mktemp -d)" \
48+
&& curl -fsSL ${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \
49+
${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \
50+
&& curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \
51+
&& gpg --batch --verify latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
52+
# - Unpack the toolchain, set libs permissions, and clean up.
53+
&& tar -xzf latest_toolchain.tar.gz --directory / --strip-components=1 \
54+
&& chmod -R o+r /usr/lib/swift \
55+
&& rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
56+
57+
# Print Installed Swift Version
58+
RUN swift --version
59+
60+
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
61+
>> /etc/bash.bashrc; \
62+
echo " ################################################################\n" \
63+
"#\t\t\t\t\t\t\t\t#\n" \
64+
"# Swift Nightly Docker Image\t\t\t\t#\n" \
65+
"# Tag: $(cat .swift_tag)\t\t\t#\n" \
66+
"#\t\t\t\t\t\t\t\t#\n" \
67+
"################################################################\n" > /etc/motd

nightly-master/centos/8/Dockerfile

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
FROM centos:8
2+
LABEL maintainer="Swift Infrastructure <[email protected]>"
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 && \
8+
yum install --enablerepo=PowerTools -y \
9+
binutils \
10+
gcc \
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+
21+
RUN ln -s /usr/bin/python2 /usr/bin/python
22+
23+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
24+
25+
# gpg --keyid-format LONG -k FAF6989E1BC16FEA
26+
# pub rsa4096/FAF6989E1BC16FEA 2019-11-07 [SC] [expires: 2021-11-06]
27+
# 8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
28+
# uid [ unknown] Swift Automatic Signing Key #3 <[email protected]>
29+
ARG SWIFT_SIGNING_KEY=8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
30+
ARG SWIFT_PLATFORM=centos
31+
ARG OS_MAJOR_VER=8
32+
ARG SWIFT_WEBROOT=https://swift.org/builds/development
33+
34+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
35+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
36+
OS_MAJOR_VER=$OS_MAJOR_VER \
37+
OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER \
38+
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER"
39+
40+
RUN echo "${SWIFT_WEBROOT}/latest-build.yml"
41+
42+
RUN set -e; \
43+
# - Latest Toolchain info
44+
export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \
45+
&& export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \
46+
&& export DOWNLOAD_DIR=$(echo $download | sed "s/-${OS_VER}.tar.gz//g") \
47+
&& echo $DOWNLOAD_DIR > .swift_tag \
48+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
49+
&& export GNUPGHOME="$(mktemp -d)" \
50+
&& curl -fsSL ${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \
51+
${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \
52+
&& curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \
53+
&& gpg --batch --verify latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
54+
# - Unpack the toolchain, set libs permissions, and clean up.
55+
&& tar -xzf latest_toolchain.tar.gz --directory / --strip-components=1 \
56+
&& chmod -R o+r /usr/lib/swift \
57+
&& rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz
58+
59+
# Print Installed Swift Version
60+
RUN swift --version
61+
62+
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
63+
>> /etc/bash.bashrc; \
64+
echo " ################################################################\n" \
65+
"#\t\t\t\t\t\t\t\t#\n" \
66+
"# Swift Nightly Docker Image\t\t\t\t#\n" \
67+
"# Tag: $(cat .swift_tag)\t\t\t#\n" \
68+
"#\t\t\t\t\t\t\t\t#\n" \
69+
"################################################################\n" > /etc/motd
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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+
libedit2 \
10+
libsqlite3-0 \
11+
libc6-dev \
12+
binutils \
13+
libgcc-9-dev \
14+
libstdc++-9-dev \
15+
zlib1g-dev \
16+
libz3-dev \
17+
libpython2.7 \
18+
tzdata \
19+
git \
20+
pkg-config \
21+
gnupg2 \
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+
# gpg --keyid-format LONG -k FAF6989E1BC16FEA
27+
# pub rsa4096/FAF6989E1BC16FEA 2019-11-07 [SC] [expires: 2021-11-06]
28+
# 8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
29+
# uid [ unknown] Swift Automatic Signing Key #3 <[email protected]>
30+
ARG SWIFT_SIGNING_KEY=8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
31+
ARG SWIFT_PLATFORM=ubuntu
32+
ARG OS_MAJOR_VER=20
33+
ARG OS_MIN_VER=04
34+
ARG SWIFT_WEBROOT=https://swift.org/builds/development
35+
36+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
37+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
38+
OS_MAJOR_VER=$OS_MAJOR_VER \
39+
OS_MIN_VER=$OS_MIN_VER \
40+
OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER.$OS_MIN_VER \
41+
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MIN_VER"
42+
43+
RUN echo "${SWIFT_WEBROOT}/latest-build.yml"
44+
45+
RUN set -e; \
46+
# - Grab curl here so we cache better up above
47+
export DEBIAN_FRONTEND=noninteractive \
48+
&& apt-get -q update && apt-get -q install -y curl && rm -rf /var/lib/apt/lists/* \
49+
# - Latest Toolchain info
50+
&& export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \
51+
&& export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \
52+
&& export DOWNLOAD_DIR=$(echo $download | sed "s/-${OS_VER}.tar.gz//g") \
53+
&& echo $DOWNLOAD_DIR > .swift_tag \
54+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
55+
&& export GNUPGHOME="$(mktemp -d)" \
56+
&& curl -fsSL ${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \
57+
${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \
58+
&& curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \
59+
&& gpg --batch --verify latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
60+
# - Unpack the toolchain, set libs permissions, and clean up.
61+
&& tar -xzf latest_toolchain.tar.gz --directory / --strip-components=1 \
62+
&& chmod -R o+r /usr/lib/swift \
63+
&& rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
64+
&& apt-get purge --auto-remove -y curl
65+
66+
# Print Installed Swift Version
67+
RUN swift --version
68+
69+
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
70+
>> /etc/bash.bashrc; \
71+
echo " ################################################################\n" \
72+
"#\t\t\t\t\t\t\t\t#\n" \
73+
"# Swift Nightly Docker Image\t\t\t\t#\n" \
74+
"# Tag: $(cat .swift_tag)\t\t\t#\n" \
75+
"#\t\t\t\t\t\t\t\t#\n" \
76+
"################################################################\n" > /etc/motd
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
FROM amazonlinux:2
2+
3+
RUN yum -y update && yum install shadow-utils.x86_64 -y
4+
5+
RUN groupadd -g 998 build-user && \
6+
useradd -m -r -u 42 -g build-user build-user
7+
8+
# The build needs a package from the EPEL repo so that needs to be enabled.
9+
# https://www.tecmint.com/install-epel-repository-on-centos/
10+
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
11+
12+
# Update and install needed build packages
13+
RUN yum -y update
14+
RUN yum -y group install "development tools"
15+
RUN yum -y install \
16+
clang \
17+
cmake \
18+
curl-devel \
19+
git \
20+
libbsd-devel \
21+
libedit-devel \
22+
libicu-devel \
23+
libuuid-devel \
24+
libxml2-devel \
25+
ncurses-devel \
26+
pexpect \
27+
pkgconfig \
28+
procps-ng \
29+
python \
30+
python-devel \
31+
python-pkgconfig \
32+
python-six \
33+
rsync \
34+
sqlite-devel \
35+
swig \
36+
tzdata \
37+
uuid-devel \
38+
wget \
39+
which
40+
41+
USER build-user
42+
43+
WORKDIR /home/build-user

swift-ci/master/centos/8/Dockerfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
FROM centos:centos8
2+
3+
RUN groupadd -g 42 build-user && \
4+
useradd -m -r -u 42 -g build-user build-user
5+
6+
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
7+
8+
RUN yum -y update
9+
10+
RUN yum install --enablerepo=PowerTools -y \
11+
autoconf \
12+
clang \
13+
cmake \
14+
git \
15+
libbsd-devel \
16+
libcurl-devel \
17+
libedit-devel \
18+
libicu-devel \
19+
libtool \
20+
libuuid-devel \
21+
libxml2-devel \
22+
make \
23+
ncurses-devel \
24+
ninja-build \
25+
pcre-devel \
26+
python2 \
27+
python2-devel \
28+
python2-six \
29+
python3 \
30+
python3-six \
31+
python3-pexpect \
32+
platform-python-devel \
33+
sqlite-devel \
34+
swig \
35+
rsync \
36+
tar \
37+
which
38+
39+
RUN ln -s /usr/bin/python2 /usr/bin/python
40+
41+
USER build-user
42+
43+
WORKDIR /home/build-user

swift-ci/master/debian/9/Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
FROM debian:9
2+
3+
RUN groupadd -g 998 build-user && \
4+
useradd -m -r -u 998 -g build-user build-user
5+
6+
ENV DEBIAN_FRONTEND="noninteractive"
7+
8+
RUN apt update
9+
10+
RUN apt -y install \
11+
build-essential \
12+
clang \
13+
cmake \
14+
git \
15+
icu-devtools \
16+
libcurl4-openssl-dev \
17+
libedit-dev \
18+
libicu-dev \
19+
libncurses5-dev \
20+
libsqlite3-dev \
21+
libxml2-dev \
22+
ninja-build \
23+
python \
24+
python-dev \
25+
python-six \
26+
pkg-config \
27+
rsync \
28+
swig \
29+
systemtap-sdt-dev \
30+
tzdata \
31+
unzip \
32+
vim \
33+
uuid-dev
34+
35+
USER build-user
36+
37+
WORKDIR /home/build-user
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM ubuntu:19.10
2+
3+
RUN groupadd -g 998 build-user && \
4+
useradd -m -r -u 998 -g build-user build-user
5+
6+
ENV DEBIAN_FRONTEND="noninteractive"
7+
8+
RUN apt update
9+
10+
RUN apt -y install \
11+
clang \
12+
cmake \
13+
git \
14+
icu-devtools \
15+
libcurl4-openssl-dev \
16+
libedit-dev \
17+
libicu-dev \
18+
libncurses5-dev \
19+
libpython-dev \
20+
libsqlite3-dev \
21+
libxml2-dev \
22+
ninja-build \
23+
pkg-config \
24+
python \
25+
python-six \
26+
rsync \
27+
swig \
28+
systemtap-sdt-dev \
29+
tzdata \
30+
unzip \
31+
uuid-dev
32+
33+
USER build-user
34+
35+
WORKDIR /home/build-user

0 commit comments

Comments
 (0)