Skip to content

Commit 0acb505

Browse files
authored
Add UBI 9 for main and Swift 5.8 nightly docker images (#337)
* Add UBI 9 for main and Swift 5.8 nightly docker images * Fix the buildx commands
1 parent 6fb5fdf commit 0acb505

File tree

5 files changed

+267
-1
lines changed

5 files changed

+267
-1
lines changed

ci_test.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ def main():
7373
if "buildx" in dockerfile:
7474
# if "buildx" is part of the path, we want to use the new buildx build system and build
7575
# for both amd64 and arm64.
76-
cmd = "docker buildx build --platform linux/arm64,linux/amd64 --no-cache=true --driver-opt env.http_proxy={} --driver-opt env.https_proxy={} {}".format(os.environ['http_proxy'], os.environ['https_proxy'], dockerfile)
76+
cmd = "docker buildx create --use --driver-opt env.http_proxy={} --driver-opt env.https_proxy={}".format(os.environ['http_proxy'], os.environ['https_proxy'])
77+
run_command(cmd, log_file)
78+
cmd = "docker buildx inspect --bootstrap"
79+
run_command(cmd, log_file)
80+
cmd = "docker buildx build --platform linux/arm64,linux/amd64 --no-cache=true --build-arg env.http_proxy={} --build-arg env.https_proxy={} {}".format(os.environ['http_proxy'], os.environ['https_proxy'], dockerfile)
7781
status = run_command(cmd, log_file)
7882
results[dockerfile] = status
7983
if status != 0:

nightly-5.8/rhel-ubi/9/Dockerfile

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
FROM redhat/ubi9
2+
3+
LABEL maintainer="Swift Infrastructure <[email protected]>"
4+
LABEL description="Docker Container for the Swift programming language"
5+
6+
RUN yum install -y \
7+
git \
8+
gcc-c++ \
9+
libcurl-devel \
10+
libedit-devel \
11+
libuuid-devel \
12+
libxml2-devel \
13+
ncurses-devel \
14+
python3-devel \
15+
rsync \
16+
sqlite-devel \
17+
unzip \
18+
zip
19+
20+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
21+
22+
# gpg --keyid-format LONG -k F167DF1ACF9CE069
23+
# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2023-11-08]
24+
# E813C892820A6FA13755B268F167DF1ACF9CE069
25+
# uid [ unknown] Swift Automatic Signing Key #4 <[email protected]>
26+
ARG SWIFT_SIGNING_KEY=8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
27+
ARG SWIFT_PLATFORM=ubi
28+
ARG OS_MAJOR_VER=9
29+
ARG SWIFT_WEBROOT=https://download.swift.org/swift-5.8-branch
30+
31+
ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
32+
SWIFT_PLATFORM=$SWIFT_PLATFORM \
33+
OS_MAJOR_VER=$OS_MAJOR_VER \
34+
OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER \
35+
SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER"
36+
37+
RUN echo "${SWIFT_WEBROOT}/latest-build.yml"
38+
39+
RUN set -e; \
40+
# - Latest Toolchain info
41+
export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \
42+
&& export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \
43+
&& export DOWNLOAD_DIR=$(echo $download | sed "s/-${OS_VER}.tar.gz//g") \
44+
&& echo $DOWNLOAD_DIR > .swift_tag \
45+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
46+
&& export GNUPGHOME="$(mktemp -d)" \
47+
&& curl -fL ${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \
48+
${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \
49+
&& curl -fL https://swift.org/keys/all-keys.asc | gpg --import - \
50+
&& gpg --batch --verify latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
51+
# - Unpack the toolchain, set libs permissions, and clean up.
52+
&& tar -xzf latest_toolchain.tar.gz --directory / --strip-components=1 \
53+
&& chmod -R o+r /usr/lib/swift \
54+
&& rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz
55+
56+
# Print Installed Swift Version
57+
RUN swift --version
58+
59+
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
60+
>> /etc/bashrc; \
61+
echo -e " ################################################################\n" \
62+
"#\t\t\t\t\t\t\t\t#\n" \
63+
"# Swift Nightly Docker Image\t\t\t\t\t#\n" \
64+
"# Tag: $(cat .swift_tag)\t\t\t#\n" \
65+
"#\t\t\t\t\t\t\t\t#\n" \
66+
"################################################################\n" > /etc/motd
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
FROM redhat/ubi9 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 \
6+
git \
7+
gcc-c++ \
8+
libcurl-devel \
9+
libedit-devel \
10+
libuuid-devel \
11+
libxml2-devel \
12+
ncurses-devel \
13+
python3-devel \
14+
rsync \
15+
sqlite-devel \
16+
unzip \
17+
zip
18+
19+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
20+
21+
# gpg --keyid-format LONG -k FAF6989E1BC16FEA
22+
# pub rsa4096/FAF6989E1BC16FEA 2019-11-07 [SC] [expires: 2021-11-06]
23+
# 8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
24+
# uid [ unknown] Swift Automatic Signing Key #3 <[email protected]>
25+
ARG SWIFT_SIGNING_KEY=8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
26+
ARG SWIFT_PLATFORM=ubi
27+
ARG OS_MAJOR_VER=9
28+
ARG SWIFT_WEBROOT=https://download.swift.org/swift-5.8-branch
29+
30+
# This is a small trick to enable if/else for arm64 and amd64.
31+
# Because of https://bugs.swift.org/browse/SR-14872 we need adjust tar options.
32+
FROM base AS base-amd64
33+
ARG OS_ARCH_SUFFIX=
34+
35+
FROM base AS base-arm64
36+
ARG OS_ARCH_SUFFIX=-aarch64
37+
38+
FROM base-$TARGETARCH AS final
39+
40+
ARG OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER$OS_ARCH_SUFFIX
41+
ARG PLATFORM_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_ARCH_SUFFIX"
42+
43+
RUN echo "${PLATFORM_WEBROOT}/latest-build.yml"
44+
45+
RUN set -e; \
46+
# - Latest Toolchain info
47+
export $(curl -s ${PLATFORM_WEBROOT}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \
48+
&& export $(curl -s ${PLATFORM_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 ${PLATFORM_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \
54+
${PLATFORM_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
73+
74+
RUN echo 'source /etc/bashrc' >> /root/.bashrc
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
FROM redhat/ubi9
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 F167DF1ACF9CE069
8+
# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2023-11-08]
9+
# E813C892820A6FA13755B268F167DF1ACF9CE069
10+
# uid [ unknown] Swift Automatic Signing Key #4 <[email protected]>
11+
ARG SWIFT_SIGNING_KEY=8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
12+
ARG SWIFT_PLATFORM=ubi
13+
ARG OS_MAJOR_VER=9
14+
ARG SWIFT_WEBROOT=https://download.swift.org/swift-5.8-branch
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: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
FROM redhat/ubi9 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 \
6+
git \
7+
gcc-c++ \
8+
libcurl-devel \
9+
libedit-devel \
10+
libuuid-devel \
11+
libxml2-devel \
12+
ncurses-devel \
13+
python3-devel \
14+
rsync \
15+
sqlite-devel \
16+
unzip \
17+
zip
18+
19+
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
20+
21+
# gpg --keyid-format LONG -k FAF6989E1BC16FEA
22+
# pub rsa4096/FAF6989E1BC16FEA 2019-11-07 [SC] [expires: 2021-11-06]
23+
# 8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
24+
# uid [ unknown] Swift Automatic Signing Key #3 <[email protected]>
25+
ARG SWIFT_SIGNING_KEY=8A7495662C3CD4AE18D95637FAF6989E1BC16FEA
26+
ARG SWIFT_PLATFORM=ubi
27+
ARG OS_MAJOR_VER=9
28+
ARG SWIFT_WEBROOT=https://download.swift.org/development
29+
30+
# This is a small trick to enable if/else for arm64 and amd64.
31+
# Because of https://bugs.swift.org/browse/SR-14872 we need adjust tar options.
32+
FROM base AS base-amd64
33+
ARG OS_ARCH_SUFFIX=
34+
35+
FROM base AS base-arm64
36+
ARG OS_ARCH_SUFFIX=-aarch64
37+
38+
FROM base-$TARGETARCH AS final
39+
40+
ARG OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER$OS_ARCH_SUFFIX
41+
ARG PLATFORM_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_ARCH_SUFFIX"
42+
43+
RUN echo "${PLATFORM_WEBROOT}/latest-build.yml"
44+
45+
RUN set -e; \
46+
# - Latest Toolchain info
47+
export $(curl -s ${PLATFORM_WEBROOT}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \
48+
&& export $(curl -s ${PLATFORM_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 ${PLATFORM_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \
54+
${PLATFORM_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
73+
74+
RUN echo 'source /etc/bashrc' >> /root/.bashrc

0 commit comments

Comments
 (0)