From 7cc4060a86a53132db008219f9fff2ef66f4aaee Mon Sep 17 00:00:00 2001 From: tom doron Date: Mon, 14 Mar 2022 20:56:02 -0700 Subject: [PATCH 1/2] add support for oraclelinux 8 motivation: with centos 8 deprecated, teams are moving to oracle linux 8 changes: * add ci docker setup for producing oracle linux 8 tarballs --- swift-ci/master/oraclelinux/8/Dockerfile | 45 ++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 swift-ci/master/oraclelinux/8/Dockerfile diff --git a/swift-ci/master/oraclelinux/8/Dockerfile b/swift-ci/master/oraclelinux/8/Dockerfile new file mode 100644 index 00000000..3fe820ce --- /dev/null +++ b/swift-ci/master/oraclelinux/8/Dockerfile @@ -0,0 +1,45 @@ +FROM oraclelinux:8 + +RUN groupadd -g 42 build-user && \ + useradd -m -r -u 42 -g build-user build-user + +RUN yum install -y oracle-epel-release-el8 + +RUN yum install --enablerepo=ol8_codeready_builder -y \ + autoconf \ + clang-12.0.1 \ + cmake \ + diffutils \ + git \ + glibc-static \ + libbsd-devel \ + libcurl-devel \ + libedit-devel \ + libicu-devel \ + libstdc++-static \ + libtool \ + libuuid-devel \ + libxml2-devel \ + make \ + ncurses-devel \ + ninja-build \ + pcre-devel \ + procps-ng \ + python2 \ + python2-devel \ + python2-six \ + python3 \ + python3-six \ + python3-pexpect \ + platform-python-devel \ + sqlite-devel \ + swig \ + rsync \ + tar \ + which + +RUN ln -s /usr/bin/python2 /usr/bin/python + +USER build-user + +WORKDIR /home/build-user From 6ed6315182ee4e612ca95f603cdb4cb06f54f7f3 Mon Sep 17 00:00:00 2001 From: tom doron Date: Mon, 14 Mar 2022 20:56:02 -0700 Subject: [PATCH 2/2] add support for oraclelinux 8 motivation: with centos 8 deprecated, teams are moving to oracle linux 8 changes: * add nightly main docker setup for oracle linux 8 --- nightly-main/oraclelinux/8/Dockerfile | 72 +++++++++++++++++ nightly-main/oraclelinux/8/buildx/Dockerfile | 81 ++++++++++++++++++++ nightly-main/oraclelinux/8/slim/Dockerfile | 48 ++++++++++++ 3 files changed, 201 insertions(+) create mode 100644 nightly-main/oraclelinux/8/Dockerfile create mode 100644 nightly-main/oraclelinux/8/buildx/Dockerfile create mode 100644 nightly-main/oraclelinux/8/slim/Dockerfile diff --git a/nightly-main/oraclelinux/8/Dockerfile b/nightly-main/oraclelinux/8/Dockerfile new file mode 100644 index 00000000..7f944818 --- /dev/null +++ b/nightly-main/oraclelinux/8/Dockerfile @@ -0,0 +1,72 @@ +FROM oraclelinux:8 +LABEL maintainer="Swift Infrastructure " +LABEL description="Docker Container for the Swift programming language" + +RUN yum install -y oracle-epel-release-el8 + +RUN yum install --enablerepo=ol8_codeready_builder -y \ + binutils \ + gcc \ + git \ + glibc-static \ + libbsd-devel \ + libcurl-devel \ + libedit \ + libedit-devel \ + libicu-devel \ + libstdc++-static \ + libxml2-devel \ + pkg-config \ + python2 \ + sqlite \ + zlib-devel + +RUN ln -s /usr/bin/python2 /usr/bin/python + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# gpg --keyid-format LONG -k FAF6989E1BC16FEA +# pub rsa4096/FAF6989E1BC16FEA 2019-11-07 [SC] [expires: 2021-11-06] +# 8A7495662C3CD4AE18D95637FAF6989E1BC16FEA +# uid [ unknown] Swift Automatic Signing Key #3 +ARG SWIFT_SIGNING_KEY=8A7495662C3CD4AE18D95637FAF6989E1BC16FEA +ARG SWIFT_PLATFORM=oraclelinux +ARG OS_MAJOR_VER=8 +ARG SWIFT_WEBROOT=https://download.swift.org/development + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + OS_MAJOR_VER=$OS_MAJOR_VER \ + OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER \ + SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER" + +RUN echo "${SWIFT_WEBROOT}/latest-build.yml" + +RUN set -e; \ + # - Latest Toolchain info + export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \ + && export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \ + && export DOWNLOAD_DIR=$(echo $download | sed "s/-${OS_VER}.tar.gz//g") \ + && echo $DOWNLOAD_DIR > .swift_tag \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL ${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \ + ${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \ + && curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \ + && gpg --batch --verify latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && tar -xzf latest_toolchain.tar.gz --directory / --strip-components=1 \ + && chmod -R o+r /usr/lib/swift \ + && rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz + +# Print Installed Swift Version +RUN swift --version + +RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \ + >> /etc/bashrc; \ + echo -e " ################################################################\n" \ + "#\t\t\t\t\t\t\t\t#\n" \ + "# Swift Nightly Docker Image\t\t\t\t\t#\n" \ + "# Tag: $(cat .swift_tag)\t\t\t#\n" \ + "#\t\t\t\t\t\t\t\t#\n" \ + "################################################################\n" > /etc/motd diff --git a/nightly-main/oraclelinux/8/buildx/Dockerfile b/nightly-main/oraclelinux/8/buildx/Dockerfile new file mode 100644 index 00000000..52ec2240 --- /dev/null +++ b/nightly-main/oraclelinux/8/buildx/Dockerfile @@ -0,0 +1,81 @@ +FROM oraclelinux:8 AS base +LABEL maintainer="Swift Infrastructure " +LABEL description="Docker Container for the Swift programming language" + +RUN yum install -y oracle-epel-release-el8 + +RUN yum install --enablerepo=ol8_codeready_builder -y \ + binutils \ + gcc \ + git \ + glibc-static \ + libbsd-devel \ + libcurl-devel \ + libedit \ + libedit-devel \ + libicu-devel \ + libstdc++-static \ + libxml2-devel \ + pkg-config \ + python2 \ + sqlite \ + zlib-devel + +RUN ln -s /usr/bin/python2 /usr/bin/python + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# gpg --keyid-format LONG -k FAF6989E1BC16FEA +# pub rsa4096/FAF6989E1BC16FEA 2019-11-07 [SC] [expires: 2021-11-06] +# 8A7495662C3CD4AE18D95637FAF6989E1BC16FEA +# uid [ unknown] Swift Automatic Signing Key #3 +ARG SWIFT_SIGNING_KEY=8A7495662C3CD4AE18D95637FAF6989E1BC16FEA +ARG SWIFT_PLATFORM=oraclelinux +ARG OS_MAJOR_VER=8 +ARG SWIFT_WEBROOT=https://download.swift.org/development + +# This is a small trick to enable if/else for arm64 and amd64. +# Because of https://bugs.swift.org/browse/SR-14872 we need adjust tar options. +FROM base AS base-amd64 +ARG OS_ARCH_SUFFIX= +ARG ADDITIONAL_TAR_OPTIONS="--strip-components=1" + +FROM base AS base-arm64 +ARG OS_ARCH_SUFFIX=-aarch64 +ARG ADDITIONAL_TAR_OPTIONS= + +FROM base-$TARGETARCH AS final + +ARG OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER$OS_ARCH_SUFFIX +ARG PLATFORM_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_ARCH_SUFFIX" + +RUN echo "${PLATFORM_WEBROOT}/latest-build.yml" + +RUN set -e; \ + # - Latest Toolchain info + export $(curl -s ${PLATFORM_WEBROOT}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \ + && export $(curl -s ${PLATFORM_WEBROOT}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \ + && export DOWNLOAD_DIR=$(echo $download | sed "s/-${OS_VER}.tar.gz//g") \ + && echo $DOWNLOAD_DIR > .swift_tag \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL ${PLATFORM_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \ + ${PLATFORM_WEBROOT}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \ + && curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \ + && gpg --batch --verify latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && tar -xzf latest_toolchain.tar.gz --directory / ${ADDITIONAL_TAR_OPTIONS} \ + && chmod -R o+r /usr/lib/swift \ + && rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz + +# Print Installed Swift Version +RUN swift --version + +RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \ + >> /etc/bashrc; \ + echo -e " ################################################################\n" \ + "#\t\t\t\t\t\t\t\t#\n" \ + "# Swift Nightly Docker Image\t\t\t\t\t#\n" \ + "# Tag: $(cat .swift_tag)\t\t\t#\n" \ + "#\t\t\t\t\t\t\t\t#\n" \ + "################################################################\n" > /etc/motd diff --git a/nightly-main/oraclelinux/8/slim/Dockerfile b/nightly-main/oraclelinux/8/slim/Dockerfile new file mode 100644 index 00000000..e9075253 --- /dev/null +++ b/nightly-main/oraclelinux/8/slim/Dockerfile @@ -0,0 +1,48 @@ +FROM oraclelinux:8 +LABEL maintainer="Swift Infrastructure " +LABEL description="Docker Container for the Swift programming language" + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# gpg --keyid-format LONG -k FAF6989E1BC16FEA +# pub rsa4096/FAF6989E1BC16FEA 2019-11-07 [SC] [expires: 2021-11-06] +# 8A7495662C3CD4AE18D95637FAF6989E1BC16FEA +# uid [ unknown] Swift Automatic Signing Key #3 +ARG SWIFT_SIGNING_KEY=8A7495662C3CD4AE18D95637FAF6989E1BC16FEA +ARG SWIFT_PLATFORM=oraclelinux +ARG OS_MAJOR_VER=8 +ARG SWIFT_WEBROOT=https://download.swift.org/development + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + OS_MAJOR_VER=$OS_MAJOR_VER \ + OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER \ + SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER" + +RUN echo "${SWIFT_WEBROOT}/latest-build.yml" + +RUN set -e; \ + # - Latest Toolchain info + export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \ + && export $(curl -s ${SWIFT_WEBROOT}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \ + && export DOWNLOAD_DIR=$(echo $download | sed "s/-${OS_VER}.tar.gz//g") \ + && echo $DOWNLOAD_DIR > .swift_tag \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL ${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \ + ${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \ + && curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \ + && gpg --batch --verify latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && tar -xzf latest_toolchain.tar.gz --directory / --strip-components=1 ${DOWNLOAD_DIR}-${OS_VER}/usr/lib/swift/linux \ + && chmod -R o+r /usr/lib/swift \ + && rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz + +RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \ + >> /etc/bashrc; \ + echo -e " ################################################################\n" \ + "#\t\t\t\t\t\t\t\t#\n" \ + "# Swift Nightly Docker Image\t\t\t\t\t#\n" \ + "# Tag: $(cat .swift_tag)\t\t\t#\n" \ + "#\t\t\t\t\t\t\t\t#\n" \ + "################################################################\n" > /etc/motd