Skip to content

Commit da2e928

Browse files
committed
add support for oraclelinux 8
motivation: with centos 8 deprecated, teams are moving to oracle linux 8 changes: * add ci docker setup for oracle linux 8 * add nightly main docker setup for oracle linux 8
1 parent ff51ee6 commit da2e928

File tree

4 files changed

+246
-0
lines changed

4 files changed

+246
-0
lines changed

nightly-main/oraclelinux/8/Dockerfile

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
FROM oraclelinux:8
2+
LABEL maintainer="Swift Infrastructure <[email protected]>"
3+
LABEL description="Docker Container for the Swift programming language"
4+
5+
RUN yum install -y oracle-epel-release-el8
6+
7+
RUN yum install --enablerepo=ol8_codeready_builder -y \
8+
binutils \
9+
gcc \
10+
git \
11+
glibc-static \
12+
libbsd-devel \
13+
libcurl-devel \
14+
libedit \
15+
libedit-devel \
16+
libicu-devel \
17+
libstdc++-static \
18+
libxml2-devel \
19+
pkg-config \
20+
python2 \
21+
sqlite \
22+
zlib-devel
23+
24+
RUN ln -s /usr/bin/python2 /usr/bin/python
25+
26+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
27+
28+
# gpg --keyid-format LONG -k FAF6989E1BC16FEA
29+
# pub rsa4096/FAF6989E1BC16FEA 2019-11-07 [SC] [expires: 2021-11-06]
30+
# 8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
31+
# uid [ unknown] Swift Automatic Signing Key #3 <[email protected]>
32+
ARG SWIFT_SIGNING_KEY=8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
33+
ARG SWIFT_PLATFORM=centos
34+
ARG OS_MAJOR_VER=8
35+
ARG SWIFT_WEBROOT=https://download.swift.org/development
36+
37+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
38+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
39+
OS_MAJOR_VER=$OS_MAJOR_VER \
40+
OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER \
41+
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER"
42+
43+
RUN echo "${SWIFT_WEBROOT}/latest-build.yml"
44+
45+
RUN set -e; \
46+
# - Latest Toolchain info
47+
export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \
48+
&& export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \
49+
&& export DOWNLOAD_DIR=$(echo $download | sed "s/-${OS_VER}.tar.gz//g") \
50+
&& echo $DOWNLOAD_DIR > .swift_tag \
51+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
52+
&& export GNUPGHOME="$(mktemp -d)" \
53+
&& curl -fsSL ${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \
54+
${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \
55+
&& curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \
56+
&& gpg --batch --verify latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
57+
# - Unpack the toolchain, set libs permissions, and clean up.
58+
&& tar -xzf latest_toolchain.tar.gz --directory / --strip-components=1 \
59+
&& chmod -R o+r /usr/lib/swift \
60+
&& rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz
61+
62+
# Print Installed Swift Version
63+
RUN swift --version
64+
65+
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
66+
>> /etc/bashrc; \
67+
echo -e " ################################################################\n" \
68+
"#\t\t\t\t\t\t\t\t#\n" \
69+
"# Swift Nightly Docker Image\t\t\t\t\t#\n" \
70+
"# Tag: $(cat .swift_tag)\t\t\t#\n" \
71+
"#\t\t\t\t\t\t\t\t#\n" \
72+
"################################################################\n" > /etc/motd
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
FROM oraclelinux:8 AS base
2+
LABEL maintainer="Swift Infrastructure <[email protected]>"
3+
LABEL description="Docker Container for the Swift programming language"
4+
5+
RUN yum install -y oracle-epel-release-el8
6+
7+
RUN yum install --enablerepo=ol8_codeready_builder -y \
8+
binutils \
9+
gcc \
10+
git \
11+
glibc-static \
12+
libbsd-devel \
13+
libcurl-devel \
14+
libedit \
15+
libedit-devel \
16+
libicu-devel \
17+
libstdc++-static \
18+
libxml2-devel \
19+
pkg-config \
20+
python2 \
21+
sqlite \
22+
zlib-devel
23+
24+
RUN ln -s /usr/bin/python2 /usr/bin/python
25+
26+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
27+
28+
# gpg --keyid-format LONG -k FAF6989E1BC16FEA
29+
# pub rsa4096/FAF6989E1BC16FEA 2019-11-07 [SC] [expires: 2021-11-06]
30+
# 8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
31+
# uid [ unknown] Swift Automatic Signing Key #3 <[email protected]>
32+
ARG SWIFT_SIGNING_KEY=8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
33+
ARG SWIFT_PLATFORM=centos
34+
ARG OS_MAJOR_VER=8
35+
ARG SWIFT_WEBROOT=https://download.swift.org/development
36+
37+
# This is a small trick to enable if/else for arm64 and amd64.
38+
# Because of https://bugs.swift.org/browse/SR-14872 we need adjust tar options.
39+
FROM base AS base-amd64
40+
ARG OS_ARCH_SUFFIX=
41+
ARG ADDITIONAL_TAR_OPTIONS="--strip-components=1"
42+
43+
FROM base AS base-arm64
44+
ARG OS_ARCH_SUFFIX=-aarch64
45+
ARG ADDITIONAL_TAR_OPTIONS=
46+
47+
FROM base-$TARGETARCH AS final
48+
49+
ARG OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER$OS_ARCH_SUFFIX
50+
ARG PLATFORM_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_ARCH_SUFFIX"
51+
52+
RUN echo "${PLATFORM_WEBROOT}/latest-build.yml"
53+
54+
RUN set -e; \
55+
# - Latest Toolchain info
56+
export $(curl -s ${PLATFORM_WEBROOT}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \
57+
&& export $(curl -s ${PLATFORM_WEBROOT}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \
58+
&& export DOWNLOAD_DIR=$(echo $download | sed "s/-${OS_VER}.tar.gz//g") \
59+
&& echo $DOWNLOAD_DIR > .swift_tag \
60+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
61+
&& export GNUPGHOME="$(mktemp -d)" \
62+
&& curl -fsSL ${PLATFORM_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \
63+
${PLATFORM_WEBROOT}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \
64+
&& curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \
65+
&& gpg --batch --verify latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
66+
# - Unpack the toolchain, set libs permissions, and clean up.
67+
&& tar -xzf latest_toolchain.tar.gz --directory / ${ADDITIONAL_TAR_OPTIONS} \
68+
&& chmod -R o+r /usr/lib/swift \
69+
&& rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz
70+
71+
# Print Installed Swift Version
72+
RUN swift --version
73+
74+
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
75+
>> /etc/bashrc; \
76+
echo -e " ################################################################\n" \
77+
"#\t\t\t\t\t\t\t\t#\n" \
78+
"# Swift Nightly Docker Image\t\t\t\t\t#\n" \
79+
"# Tag: $(cat .swift_tag)\t\t\t#\n" \
80+
"#\t\t\t\t\t\t\t\t#\n" \
81+
"################################################################\n" > /etc/motd
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
FROM oraclelinux:8
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+
# gpg --keyid-format LONG -k FAF6989E1BC16FEA
8+
# pub rsa4096/FAF6989E1BC16FEA 2019-11-07 [SC] [expires: 2021-11-06]
9+
# 8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
10+
# uid [ unknown] Swift Automatic Signing Key #3 <[email protected]>
11+
ARG SWIFT_SIGNING_KEY=8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
12+
ARG SWIFT_PLATFORM=centos
13+
ARG OS_MAJOR_VER=8
14+
ARG SWIFT_WEBROOT=https://download.swift.org/development
15+
16+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
17+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
18+
OS_MAJOR_VER=$OS_MAJOR_VER \
19+
OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER \
20+
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER"
21+
22+
RUN echo "${SWIFT_WEBROOT}/latest-build.yml"
23+
24+
RUN set -e; \
25+
# - Latest Toolchain info
26+
export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \
27+
&& export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \
28+
&& export DOWNLOAD_DIR=$(echo $download | sed "s/-${OS_VER}.tar.gz//g") \
29+
&& echo $DOWNLOAD_DIR > .swift_tag \
30+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
31+
&& export GNUPGHOME="$(mktemp -d)" \
32+
&& curl -fsSL ${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \
33+
${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \
34+
&& curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \
35+
&& gpg --batch --verify latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
36+
# - Unpack the toolchain, set libs permissions, and clean up.
37+
&& tar -xzf latest_toolchain.tar.gz --directory / --strip-components=1 ${DOWNLOAD_DIR}-${OS_VER}/usr/lib/swift/linux \
38+
&& chmod -R o+r /usr/lib/swift \
39+
&& rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz
40+
41+
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
42+
>> /etc/bashrc; \
43+
echo -e " ################################################################\n" \
44+
"#\t\t\t\t\t\t\t\t#\n" \
45+
"# Swift Nightly Docker Image\t\t\t\t\t#\n" \
46+
"# Tag: $(cat .swift_tag)\t\t\t#\n" \
47+
"#\t\t\t\t\t\t\t\t#\n" \
48+
"################################################################\n" > /etc/motd
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
FROM oraclelinux:8
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 oracle-epel-release-el8
7+
8+
RUN yum install --enablerepo=ol8_codeready_builder -y \
9+
autoconf \
10+
clang-12.0.1 \
11+
cmake \
12+
diffutils \
13+
git \
14+
glibc-static \
15+
libbsd-devel \
16+
libcurl-devel \
17+
libedit-devel \
18+
libicu-devel \
19+
libstdc++-static \
20+
libtool \
21+
libuuid-devel \
22+
libxml2-devel \
23+
make \
24+
ncurses-devel \
25+
ninja-build \
26+
pcre-devel \
27+
procps-ng \
28+
python2 \
29+
python2-devel \
30+
python2-six \
31+
python3 \
32+
python3-six \
33+
python3-pexpect \
34+
platform-python-devel \
35+
sqlite-devel \
36+
swig \
37+
rsync \
38+
tar \
39+
which
40+
41+
RUN ln -s /usr/bin/python2 /usr/bin/python
42+
43+
USER build-user
44+
45+
WORKDIR /home/build-user

0 commit comments

Comments
 (0)