diff --git a/nightly-6.1/.DS_Store b/nightly-6.1/.DS_Store new file mode 100644 index 00000000..144f3581 Binary files /dev/null and b/nightly-6.1/.DS_Store differ diff --git a/nightly-6.1/amazonlinux/2/Dockerfile b/nightly-6.1/amazonlinux/2/Dockerfile new file mode 100644 index 00000000..643ca06d --- /dev/null +++ b/nightly-6.1/amazonlinux/2/Dockerfile @@ -0,0 +1,76 @@ +FROM amazonlinux:2 +LABEL maintainer="Swift Infrastructure " +LABEL description="Docker Container for the Swift programming language" + +RUN yum -y install \ + binutils \ + gcc \ + git \ + glibc-static \ + gzip \ + libbsd \ + libcurl-devel \ + libedit \ + libicu \ + libsqlite \ + libstdc++-static \ + libuuid \ + libxml2-devel \ + openssl-devel \ + python3-libs \ + tar \ + tzdata \ + unzip \ + zip \ + zlib-devel + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# gpg --keyid-format LONG -k F167DF1ACF9CE069 +# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2025-11-09] +# E813C892820A6FA13755B268F167DF1ACF9CE069 +# uid [ unknown] Swift Automatic Signing Key #4 +ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069 +ARG SWIFT_PLATFORM=amazonlinux +ARG OS_MAJOR_VER=2 +ARG SWIFT_WEBROOT=https://download.swift.org/swift-6.1-branch + +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 "[ -n \"\${TERM:-}\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bashrc; \ + ( \ + printf "################################################################\n"; \ + printf "# %-60s #\n" ""; \ + printf "# %-60s #\n" "Swift Nightly Docker Image"; \ + printf "# %-60s #\n" "Tag: $(cat .swift_tag)"; \ + printf "# %-60s #\n" ""; \ + printf "################################################################\n" \ + ) > /etc/motd + +RUN echo 'source /etc/bashrc' >> /root/.bashrc diff --git a/nightly-6.1/amazonlinux/2/buildx/Dockerfile b/nightly-6.1/amazonlinux/2/buildx/Dockerfile new file mode 100644 index 00000000..4960e3b1 --- /dev/null +++ b/nightly-6.1/amazonlinux/2/buildx/Dockerfile @@ -0,0 +1,82 @@ +FROM amazonlinux:2 AS base +LABEL maintainer="Swift Infrastructure " +LABEL description="Docker Container for the Swift programming language" + +RUN yum -y install \ + binutils \ + gcc \ + git \ + glibc-static \ + gzip \ + libbsd \ + libcurl-devel \ + libedit \ + libicu \ + libsqlite \ + libstdc++-static \ + libuuid \ + libxml2-devel \ + openssl-devel \ + tar \ + tzdata \ + unzip \ + zip \ + zlib-devel + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# gpg --keyid-format LONG -k F167DF1ACF9CE069 +# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2025-11-09] +# E813C892820A6FA13755B268F167DF1ACF9CE069 +# uid [ unknown] Swift Automatic Signing Key #4 +ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069 +ARG SWIFT_PLATFORM=amazonlinux +ARG OS_MAJOR_VER=2 +ARG SWIFT_WEBROOT=https://download.swift.org/swift-6.1-branch + +# 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= + +FROM base AS base-arm64 +ARG OS_ARCH_SUFFIX=-aarch64 + +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 / --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 "[ -n \"\${TERM:-}\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bashrc; \ + ( \ + printf "################################################################\n"; \ + printf "# %-60s #\n" ""; \ + printf "# %-60s #\n" "Swift Nightly Docker Image"; \ + printf "# %-60s #\n" "Tag: $(cat .swift_tag)"; \ + printf "# %-60s #\n" ""; \ + printf "################################################################\n" \ + ) > /etc/motd + +RUN echo 'source /etc/bashrc' >> /root/.bashrc diff --git a/nightly-6.1/amazonlinux/2/slim/Dockerfile b/nightly-6.1/amazonlinux/2/slim/Dockerfile new file mode 100644 index 00000000..809edd24 --- /dev/null +++ b/nightly-6.1/amazonlinux/2/slim/Dockerfile @@ -0,0 +1,55 @@ +FROM amazonlinux:2 +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 F167DF1ACF9CE069 +# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2025-11-09] +# E813C892820A6FA13755B268F167DF1ACF9CE069 +# uid [ unknown] Swift Automatic Signing Key #4 +ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069 +ARG SWIFT_PLATFORM=amazonlinux +ARG OS_MAJOR_VER=2 +ARG SWIFT_WEBROOT=https://download.swift.org/swift-6.1-branch + +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. + && yum -y install tar gzip \ + && tar -xzf latest_toolchain.tar.gz --directory / --strip-components=1 \ + ${DOWNLOAD_DIR}-${OS_VER}/usr/lib/swift/linux \ + ${DOWNLOAD_DIR}-${OS_VER}/usr/libexec/swift/linux \ + && chmod -R o+r /usr/lib/swift /usr/libexec/swift \ + && rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \ + && yum autoremove -y tar gzip + +RUN echo "[ -n \"\${TERM:-}\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bashrc; \ + ( \ + printf "################################################################\n"; \ + printf "# %-60s #\n" ""; \ + printf "# %-60s #\n" "Swift Nightly Docker Image"; \ + printf "# %-60s #\n" "Tag: $(cat .swift_tag)"; \ + printf "# %-60s #\n" ""; \ + printf "################################################################\n" \ + ) > /etc/motd + +RUN echo 'source /etc/bashrc' >> /root/.bashrc diff --git a/nightly-6.1/centos/7/Dockerfile b/nightly-6.1/centos/7/Dockerfile new file mode 100644 index 00000000..af643877 --- /dev/null +++ b/nightly-6.1/centos/7/Dockerfile @@ -0,0 +1,95 @@ +FROM centos:7 +LABEL maintainer="Swift Infrastructure " +LABEL description="Docker Container for the Swift programming language" + +# CentOS 7 ships with git 1.x which is too old for the toolchain usage, using RH software collections to install git 2.x +RUN yum install -y centos-release-scl-rh + +RUN yum install shadow-utils.x86_64 -y \ + binutils \ + gcc \ + rh-git227-git \ + glibc-static \ + libbsd-devel \ + libcurl-devel \ + libedit \ + libedit-devel \ + libicu-devel \ + libstdc++-static \ + libxml2-devel \ + pkg-config \ + python2 \ + python3 \ + sqlite \ + unzip \ + zip \ + zlib-devel + +# Enable git 2.x from RH software collections for both login and non-login shells +RUN ln -s /opt/rh/rh-git227/enable /etc/profile.d/git.sh +ENV ENV=/etc/profile.d/git.sh +ENV BASH_ENV=$ENV + +RUN sed -i -e 's/\*__block/\*__libc_block/g' /usr/include/unistd.h + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# gpg --keyid-format LONG -k F167DF1ACF9CE069 +# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2025-11-09] +# E813C892820A6FA13755B268F167DF1ACF9CE069 +# uid [ unknown] Swift Automatic Signing Key #4 +ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069 +ARG SWIFT_PLATFORM=centos +ARG OS_MAJOR_VER=7 +ARG SWIFT_WEBROOT=https://download.swift.org/swift-6.1-branch + +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 -fL ${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \ + ${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \ + && curl -fL 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 + +# The devtoolset-8 that the Swift runtime is built against uses new +# functionality in the backdeploy `libstdc++_noshared.a` in devtoolset-a. +# A linkerscript in the devtoolset ensures that it is picked up appropriately. +# When dynamically linking the runtime, this static archive is merged into the +# shared object. When static linking, the compat library needs to be available +# to be merged into the final shared object/executable. +# +# Symlink it from the devtoolset into the static swift resource directory +RUN yum install -y centos-release-scl +RUN yum install -y devtoolset-8 +RUN ln -s /opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8/libstdc++_nonshared.a /usr/lib/swift_static/linux && \ + ln -s /opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8/libstdc++.so /usr/lib/swift_static/linux + +# Print Installed Swift Version +RUN swift --version + +RUN echo "[ -n \"\${TERM:-}\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bashrc; \ + ( \ + printf "################################################################\n"; \ + printf "# %-60s #\n" ""; \ + printf "# %-60s #\n" "Swift Nightly Docker Image"; \ + printf "# %-60s #\n" "Tag: $(cat .swift_tag)"; \ + printf "# %-60s #\n" ""; \ + printf "################################################################\n" \ + ) > /etc/motd diff --git a/nightly-6.1/centos/7/slim/Dockerfile b/nightly-6.1/centos/7/slim/Dockerfile new file mode 100644 index 00000000..75277a31 --- /dev/null +++ b/nightly-6.1/centos/7/slim/Dockerfile @@ -0,0 +1,51 @@ +FROM centos:7 +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 F167DF1ACF9CE069 +# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2025-11-09] +# E813C892820A6FA13755B268F167DF1ACF9CE069 +# uid [ unknown] Swift Automatic Signing Key #4 +ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069 +ARG SWIFT_PLATFORM=centos +ARG OS_MAJOR_VER=7 +ARG SWIFT_WEBROOT=https://download.swift.org/swift-6.1-branch + +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 \ + ${DOWNLOAD_DIR}-${OS_VER}/usr/libexec/swift/linux \ + && chmod -R o+r /usr/lib/swift /usr/libexec/swift \ + && rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz + +RUN echo "[ -n \"\${TERM:-}\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bashrc; \ + ( \ + printf "################################################################\n"; \ + printf "# %-60s #\n" ""; \ + printf "# %-60s #\n" "Swift Nightly Docker Image"; \ + printf "# %-60s #\n" "Tag: $(cat .swift_tag)"; \ + printf "# %-60s #\n" ""; \ + printf "################################################################\n" \ + ) > /etc/motd diff --git a/nightly-6.1/rhel-ubi/9/Dockerfile b/nightly-6.1/rhel-ubi/9/Dockerfile new file mode 100644 index 00000000..0ecba0b0 --- /dev/null +++ b/nightly-6.1/rhel-ubi/9/Dockerfile @@ -0,0 +1,67 @@ +FROM redhat/ubi9 + +LABEL maintainer="Swift Infrastructure " +LABEL description="Docker Container for the Swift programming language" + +RUN yum install -y \ + git \ + gcc-c++ \ + libcurl-devel \ + libedit-devel \ + libuuid-devel \ + libxml2-devel \ + ncurses-devel \ + python3-devel \ + rsync \ + sqlite-devel \ + unzip \ + zip + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# gpg --keyid-format LONG -k F167DF1ACF9CE069 +# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2025-11-09] +# E813C892820A6FA13755B268F167DF1ACF9CE069 +# uid [ unknown] Swift Automatic Signing Key #4 +ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069 +ARG SWIFT_PLATFORM=ubi +ARG OS_MAJOR_VER=9 +ARG SWIFT_WEBROOT=https://download.swift.org/swift-6.1-branch + +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 -fL ${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \ + ${SWIFT_WEBROOT}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \ + && curl -fL 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 "[ -n \"\${TERM:-}\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bashrc; \ + ( \ + printf "################################################################\n"; \ + printf "# %-60s #\n" ""; \ + printf "# %-60s #\n" "Swift Nightly Docker Image"; \ + printf "# %-60s #\n" "Tag: $(cat .swift_tag)"; \ + printf "# %-60s #\n" ""; \ + printf "################################################################\n" \ + ) > /etc/motd diff --git a/nightly-6.1/rhel-ubi/9/buildx/Dockerfile b/nightly-6.1/rhel-ubi/9/buildx/Dockerfile new file mode 100644 index 00000000..ee7324ba --- /dev/null +++ b/nightly-6.1/rhel-ubi/9/buildx/Dockerfile @@ -0,0 +1,75 @@ +FROM redhat/ubi9 AS base +LABEL maintainer="Swift Infrastructure " +LABEL description="Docker Container for the Swift programming language" + +RUN yum install -y \ + git \ + gcc-c++ \ + libcurl-devel \ + libedit-devel \ + libuuid-devel \ + libxml2-devel \ + ncurses-devel \ + python3-devel \ + rsync \ + sqlite-devel \ + unzip \ + zip + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# gpg --keyid-format LONG -k F167DF1ACF9CE069 +# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2025-11-09] +# E813C892820A6FA13755B268F167DF1ACF9CE069 +# uid [ unknown] Swift Automatic Signing Key #4 +ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069 +ARG SWIFT_PLATFORM=ubi +ARG OS_MAJOR_VER=9 +ARG SWIFT_WEBROOT=https://download.swift.org/swift-6.1-branch + +# 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= + +FROM base AS base-arm64 +ARG OS_ARCH_SUFFIX=-aarch64 + +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 / --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 "[ -n \"\${TERM:-}\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bashrc; \ + ( \ + printf "################################################################\n"; \ + printf "# %-60s #\n" ""; \ + printf "# %-60s #\n" "Swift Nightly Docker Image"; \ + printf "# %-60s #\n" "Tag: $(cat .swift_tag)"; \ + printf "# %-60s #\n" ""; \ + printf "################################################################\n" \ + ) > /etc/motd + +RUN echo 'source /etc/bashrc' >> /root/.bashrc diff --git a/nightly-6.1/rhel-ubi/9/slim/Dockerfile b/nightly-6.1/rhel-ubi/9/slim/Dockerfile new file mode 100644 index 00000000..d23dd9b7 --- /dev/null +++ b/nightly-6.1/rhel-ubi/9/slim/Dockerfile @@ -0,0 +1,52 @@ +FROM redhat/ubi9 +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 F167DF1ACF9CE069 +# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2025-11-09] +# E813C892820A6FA13755B268F167DF1ACF9CE069 +# uid [ unknown] Swift Automatic Signing Key #4 +ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069 +ARG SWIFT_PLATFORM=ubi +ARG OS_MAJOR_VER=9 +ARG SWIFT_WEBROOT=https://download.swift.org/swift-6.1-branch + +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 \ + ${DOWNLOAD_DIR}-${OS_VER}/usr/libexec/swift/linux \ + && chmod -R o+r /usr/lib/swift /usr/libexec/swift \ + && rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz + +RUN echo "[ -n \"\${TERM:-}\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bashrc; \ + ( \ + printf "################################################################\n"; \ + printf "# %-60s #\n" ""; \ + printf "# %-60s #\n" "Swift Nightly Docker Image"; \ + printf "# %-60s #\n" "Tag: $(cat .swift_tag)"; \ + printf "# %-60s #\n" ""; \ + printf "################################################################\n" \ + ) > /etc/motd + diff --git a/nightly-6.1/ubuntu/20.04/Dockerfile b/nightly-6.1/ubuntu/20.04/Dockerfile new file mode 100644 index 00000000..bd41e150 --- /dev/null +++ b/nightly-6.1/ubuntu/20.04/Dockerfile @@ -0,0 +1,78 @@ +FROM ubuntu:20.04 +LABEL maintainer="Swift Infrastructure " +LABEL description="Docker Container for the Swift programming language" + +RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \ + apt-get -q install -y \ + binutils \ + git \ + gnupg2 \ + libc6-dev \ + libcurl4-openssl-dev \ + libedit2 \ + libgcc-9-dev \ + libpython3.8 \ + libsqlite3-0 \ + libstdc++-9-dev \ + libxml2-dev \ + libz3-dev \ + pkg-config \ + tzdata \ + zip \ + zlib1g-dev \ + && rm -r /var/lib/apt/lists/* + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# gpg --keyid-format LONG -k F167DF1ACF9CE069 +# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2025-11-09] +# E813C892820A6FA13755B268F167DF1ACF9CE069 +# uid [ unknown] Swift Automatic Signing Key #4 +ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069 +ARG SWIFT_PLATFORM=ubuntu +ARG OS_MAJOR_VER=20 +ARG OS_MIN_VER=04 +ARG SWIFT_WEBROOT=https://download.swift.org/swift-6.1-branch + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + OS_MAJOR_VER=$OS_MAJOR_VER \ + OS_MIN_VER=$OS_MIN_VER \ + OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER.$OS_MIN_VER \ + SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MIN_VER" + +RUN echo "${SWIFT_WEBROOT}/latest-build.yml" + +RUN set -e; \ + # - Grab curl here so we cache better up above + export DEBIAN_FRONTEND=noninteractive \ + && apt-get -q update && apt-get -q install -y curl && rm -rf /var/lib/apt/lists/* \ + # - 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 \ + && apt-get purge --auto-remove -y curl + +# Print Installed Swift Version +RUN swift --version + +RUN echo "[ -n \"\${TERM:-}\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bash.bashrc; \ + ( \ + printf "################################################################\n"; \ + printf "# %-60s #\n" ""; \ + printf "# %-60s #\n" "Swift Nightly Docker Image"; \ + printf "# %-60s #\n" "Tag: $(cat .swift_tag)"; \ + printf "# %-60s #\n" ""; \ + printf "################################################################\n" \ + ) > /etc/motd diff --git a/nightly-6.1/ubuntu/20.04/buildx/Dockerfile b/nightly-6.1/ubuntu/20.04/buildx/Dockerfile new file mode 100644 index 00000000..cb923826 --- /dev/null +++ b/nightly-6.1/ubuntu/20.04/buildx/Dockerfile @@ -0,0 +1,84 @@ +FROM ubuntu:20.04 AS base +LABEL maintainer="Swift Infrastructure " +LABEL description="Docker Container for the Swift programming language" + +RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \ + apt-get -q install -y \ + binutils \ + git \ + unzip \ + gnupg2 \ + libc6-dev \ + libcurl4-openssl-dev \ + libedit2 \ + libgcc-9-dev \ + libpython3.8 \ + libsqlite3-0 \ + libstdc++-9-dev \ + libxml2-dev \ + libz3-dev \ + pkg-config \ + tzdata \ + zlib1g-dev \ + && rm -r /var/lib/apt/lists/* + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# gpg --keyid-format LONG -k F167DF1ACF9CE069 +# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2025-11-09] +# E813C892820A6FA13755B268F167DF1ACF9CE069 +# uid [ unknown] Swift Automatic Signing Key #4 +ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069 +ARG SWIFT_PLATFORM=ubuntu +ARG OS_MAJOR_VER=20 +ARG OS_MIN_VER=04 +ARG SWIFT_WEBROOT=https://download.swift.org/swift-6.1-branch + +# 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= + +FROM base AS base-arm64 +ARG OS_ARCH_SUFFIX=-aarch64 + +FROM base-$TARGETARCH AS final + +ARG OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER.$OS_MIN_VER$OS_ARCH_SUFFIX +ARG PLATFORM_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MIN_VER$OS_ARCH_SUFFIX" + +RUN echo "${PLATFORM_WEBROOT}/latest-build.yml" + +RUN set -e; \ + # - Grab curl here so we cache better up above + export DEBIAN_FRONTEND=noninteractive \ + && apt-get -q update && apt-get -q install -y curl && rm -rf /var/lib/apt/lists/* \ + # - 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 / --strip-components=1 \ + && chmod -R o+r /usr/lib/swift \ + && rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \ + && apt-get purge --auto-remove -y curl + +# Print Installed Swift Version +RUN swift --version + +RUN echo "[ -n \"\${TERM:-}\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bash.bashrc; \ + ( \ + printf "################################################################\n"; \ + printf "# %-60s #\n" ""; \ + printf "# %-60s #\n" "Swift Nightly Docker Image"; \ + printf "# %-60s #\n" "Tag: $(cat .swift_tag)"; \ + printf "# %-60s #\n" ""; \ + printf "################################################################\n" \ + ) > /etc/motd diff --git a/nightly-6.1/ubuntu/20.04/slim/Dockerfile b/nightly-6.1/ubuntu/20.04/slim/Dockerfile new file mode 100644 index 00000000..3d4d6824 --- /dev/null +++ b/nightly-6.1/ubuntu/20.04/slim/Dockerfile @@ -0,0 +1,62 @@ +FROM ubuntu:20.04 +LABEL maintainer="Swift Infrastructure " +LABEL description="Docker Container for the Swift programming language" + +RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \ + apt-get -q install -y \ + libcurl4 \ + libxml2 \ + tzdata \ + && rm -r /var/lib/apt/lists/* + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# gpg --keyid-format LONG -k F167DF1ACF9CE069 +# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2025-11-09] +# E813C892820A6FA13755B268F167DF1ACF9CE069 +# uid [ unknown] Swift Automatic Signing Key #4 +ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069 +ARG SWIFT_PLATFORM=ubuntu +ARG OS_MAJOR_VER=20 +ARG OS_MIN_VER=04 +ARG SWIFT_WEBROOT=https://download.swift.org/swift-6.1-branch + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + OS_MAJOR_VER=$OS_MAJOR_VER \ + OS_MIN_VER=$OS_MIN_VER \ + OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER.$OS_MIN_VER \ + SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MIN_VER" + +RUN set -e; \ + # - Grab curl and gpg here so we cache better up above + export DEBIAN_FRONTEND=noninteractive \ + && apt-get -q update && apt-get -q install -y curl gnupg && rm -rf /var/lib/apt/lists/* \ + # - 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 \ + ${DOWNLOAD_DIR}-${OS_VER}/usr/libexec/swift/linux \ + && chmod -R o+r /usr/lib/swift /usr/libexec/swift \ + && rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \ + && apt-get purge --auto-remove -y curl gnupg + +RUN echo "[ -n \"\${TERM:-}\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bash.bashrc; \ + ( \ + printf "################################################################\n"; \ + printf "# %-60s #\n" ""; \ + printf "# %-60s #\n" "Swift Nightly Docker Image"; \ + printf "# %-60s #\n" "Tag: $(cat .swift_tag)"; \ + printf "# %-60s #\n" ""; \ + printf "################################################################\n" \ + ) > /etc/motd diff --git a/nightly-6.1/ubuntu/22.04/Dockerfile b/nightly-6.1/ubuntu/22.04/Dockerfile new file mode 100644 index 00000000..3b01f3d5 --- /dev/null +++ b/nightly-6.1/ubuntu/22.04/Dockerfile @@ -0,0 +1,78 @@ +FROM ubuntu:22.04 +LABEL maintainer="Swift Infrastructure " +LABEL description="Docker Container for the Swift programming language" + +RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \ + apt-get -q install -y \ + binutils \ + git \ + gnupg2 \ + libc6-dev \ + libcurl4-openssl-dev \ + libedit2 \ + libgcc-11-dev \ + libpython3-dev \ + libsqlite3-0 \ + libstdc++-11-dev \ + libxml2-dev \ + libz3-dev \ + pkg-config \ + tzdata \ + zip \ + zlib1g-dev \ + && rm -r /var/lib/apt/lists/* + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# gpg --keyid-format LONG -k F167DF1ACF9CE069 +# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2025-11-09] +# E813C892820A6FA13755B268F167DF1ACF9CE069 +# uid [ unknown] Swift Automatic Signing Key #4 +ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069 +ARG SWIFT_PLATFORM=ubuntu +ARG OS_MAJOR_VER=22 +ARG OS_MIN_VER=04 +ARG SWIFT_WEBROOT=https://download.swift.org/swift-6.1-branch + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + OS_MAJOR_VER=$OS_MAJOR_VER \ + OS_MIN_VER=$OS_MIN_VER \ + OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER.$OS_MIN_VER \ + SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MIN_VER" + +RUN echo "${SWIFT_WEBROOT}/latest-build.yml" + +RUN set -e; \ + # - Grab curl here so we cache better up above + export DEBIAN_FRONTEND=noninteractive \ + && apt-get -q update && apt-get -q install -y curl && rm -rf /var/lib/apt/lists/* \ + # - 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 \ + && apt-get purge --auto-remove -y curl + +# Print Installed Swift Version +RUN swift --version + +RUN echo "[ -n \"\${TERM:-}\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bash.bashrc; \ + ( \ + printf "################################################################\n"; \ + printf "# %-60s #\n" ""; \ + printf "# %-60s #\n" "Swift Nightly Docker Image"; \ + printf "# %-60s #\n" "Tag: $(cat .swift_tag)"; \ + printf "# %-60s #\n" ""; \ + printf "################################################################\n" \ + ) > /etc/motd diff --git a/nightly-6.1/ubuntu/22.04/buildx/Dockerfile b/nightly-6.1/ubuntu/22.04/buildx/Dockerfile new file mode 100644 index 00000000..3b7547d7 --- /dev/null +++ b/nightly-6.1/ubuntu/22.04/buildx/Dockerfile @@ -0,0 +1,84 @@ +FROM ubuntu:22.04 AS base +LABEL maintainer="Swift Infrastructure " +LABEL description="Docker Container for the Swift programming language" + +RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \ + apt-get -q install -y \ + binutils \ + git \ + gnupg2 \ + libc6-dev \ + libcurl4-openssl-dev \ + libedit2 \ + libgcc-11-dev \ + libpython3-dev \ + libsqlite3-0 \ + libstdc++-11-dev \ + libxml2-dev \ + libz3-dev \ + pkg-config \ + tzdata \ + zip \ + zlib1g-dev \ + && rm -r /var/lib/apt/lists/* + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# gpg --keyid-format LONG -k F167DF1ACF9CE069 +# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2025-11-09] +# E813C892820A6FA13755B268F167DF1ACF9CE069 +# uid [ unknown] Swift Automatic Signing Key #4 +ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069 +ARG SWIFT_PLATFORM=ubuntu +ARG OS_MAJOR_VER=22 +ARG OS_MIN_VER=04 +ARG SWIFT_WEBROOT=https://download.swift.org/swift-6.1-branch + +# 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= + +FROM base AS base-arm64 +ARG OS_ARCH_SUFFIX=-aarch64 + +FROM base-$TARGETARCH AS final + +ARG OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER.$OS_MIN_VER$OS_ARCH_SUFFIX +ARG PLATFORM_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MIN_VER$OS_ARCH_SUFFIX" + +RUN echo "${PLATFORM_WEBROOT}/latest-build.yml" + +RUN set -e; \ + # - Grab curl here so we cache better up above + export DEBIAN_FRONTEND=noninteractive \ + && apt-get -q update && apt-get -q install -y curl && rm -rf /var/lib/apt/lists/* \ + # - 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 / --strip-components=1 \ + && chmod -R o+r /usr/lib/swift \ + && rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \ + && apt-get purge --auto-remove -y curl + +# Print Installed Swift Version +RUN swift --version + +RUN echo "[ -n \"\${TERM:-}\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bash.bashrc; \ + ( \ + printf "################################################################\n"; \ + printf "# %-60s #\n" ""; \ + printf "# %-60s #\n" "Swift Nightly Docker Image"; \ + printf "# %-60s #\n" "Tag: $(cat .swift_tag)"; \ + printf "# %-60s #\n" ""; \ + printf "################################################################\n" \ + ) > /etc/motd diff --git a/nightly-6.1/ubuntu/22.04/slim/Dockerfile b/nightly-6.1/ubuntu/22.04/slim/Dockerfile new file mode 100644 index 00000000..2ac17cfc --- /dev/null +++ b/nightly-6.1/ubuntu/22.04/slim/Dockerfile @@ -0,0 +1,62 @@ +FROM ubuntu:22.04 +LABEL maintainer="Swift Infrastructure " +LABEL description="Docker Container for the Swift programming language" + +RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \ + apt-get -q install -y \ + libcurl4 \ + libxml2 \ + tzdata \ + && rm -r /var/lib/apt/lists/* + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# gpg --keyid-format LONG -k F167DF1ACF9CE069 +# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2025-11-09] +# E813C892820A6FA13755B268F167DF1ACF9CE069 +# uid [ unknown] Swift Automatic Signing Key #4 +ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069 +ARG SWIFT_PLATFORM=ubuntu +ARG OS_MAJOR_VER=22 +ARG OS_MIN_VER=04 +ARG SWIFT_WEBROOT=https://download.swift.org/swift-6.1-branch + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + OS_MAJOR_VER=$OS_MAJOR_VER \ + OS_MIN_VER=$OS_MIN_VER \ + OS_VER=$SWIFT_PLATFORM$OS_MAJOR_VER.$OS_MIN_VER \ + SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_MAJOR_VER$OS_MIN_VER" + +RUN set -e; \ + # - Grab curl and gpg here so we cache better up above + export DEBIAN_FRONTEND=noninteractive \ + && apt-get -q update && apt-get -q install -y curl gnupg && rm -rf /var/lib/apt/lists/* \ + # - 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 \ + ${DOWNLOAD_DIR}-${OS_VER}/usr/libexec/swift/linux \ + && chmod -R o+r /usr/lib/swift /usr/libexec/swift \ + && rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \ + && apt-get purge --auto-remove -y curl gnupg + +RUN echo "[ -n \"\${TERM:-}\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bash.bashrc; \ + ( \ + printf "################################################################\n"; \ + printf "# %-60s #\n" ""; \ + printf "# %-60s #\n" "Swift Nightly Docker Image"; \ + printf "# %-60s #\n" "Tag: $(cat .swift_tag)"; \ + printf "# %-60s #\n" ""; \ + printf "################################################################\n" \ + ) > /etc/motd diff --git a/nightly-6.1/windows/1809/Dockerfile b/nightly-6.1/windows/1809/Dockerfile new file mode 100644 index 00000000..65552b6b --- /dev/null +++ b/nightly-6.1/windows/1809/Dockerfile @@ -0,0 +1,153 @@ +FROM mcr.microsoft.com/windows/servercore:1809 AS windows + +LABEL maintainer="Swift Infrastructure " +LABEL description="Docker Container for the Swift programming language" + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV PYTHONIOENCODING UTF-8 +ENV PYTHONUTF8=1 + +# Enable Developer Mode. +RUN reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1" +# Enable Long Paths +RUN reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem" /t REG_DWORD /f /v "LongPathsEnabled" /d "1" + +# Install Git. +# See: git-[version]-[bit].exe /SAVEINF=git.inf and /? +ARG GIT=https://github.com/git-for-windows/git/releases/download/v2.42.0.windows.2/Git-2.42.0.2-64-bit.exe +ARG GIT_SHA256=BD9B41641A258FD16D99BEECEC66132160331D685DFB4C714CEA2BCC78D63BDB +RUN Write-Host -NoNewLine ('Downloading {0} ... ' -f ${env:GIT}); \ + Invoke-WebRequest -Uri ${env:GIT} -OutFile git.exe; \ + Write-Host '✓'; \ + Write-Host -NoNewLine ('Verifying SHA256 ({0}) ... ' -f ${env:GIT_SHA256}); \ + $Hash = Get-FileHash git.exe -Algorithm sha256; \ + if ($Hash.Hash -eq ${env:GIT_SHA256}) { \ + Write-Host '✓'; \ + } else { \ + Write-Host ('✘ ({0})' -f $Hash.Hash); \ + exit 1; \ + } \ + Write-Host -NoNewLine 'Installing git ... '; \ + $Process = \ + Start-Process git.exe -Wait -PassThru -NoNewWindow -ArgumentList @( \ + '/SP-', \ + '/VERYSILENT', \ + '/SUPPRESSMSGBOXES', \ + '/NOCANCEL', \ + '/NORESTART', \ + '/CLOSEAPPLICATIONS', \ + '/FORCECLOSEAPPLICATIONS', \ + '/NOICONS', \ + '/COMPONENTS="gitlfs"', \ + '/EditorOption=VIM', \ + '/PathOption=Cmd', \ + '/SSHOption=OpenSSH', \ + '/CURLOption=WinSSL', \ + '/UseCredentialManager=Enabled', \ + '/EnableSymlinks=Enabled', \ + '/EnableFSMonitor=Enabled' \ + ); \ + if ($Process.ExitCode -eq 0) { \ + Write-Host '✓'; \ + } else { \ + Write-Host ('✘ ({0})' -f $Process.ExitCode); \ + exit 1; \ + } \ + Remove-Item -Force git.exe; \ + Remove-Item -ErrorAction SilentlyContinue -Force -Recurse ${env:TEMP}\* + +# Install Python +ARG PY39=https://www.python.org/ftp/python/3.9.13/python-3.9.13-amd64.exe +ARG PY39_SHA256=FB3D0466F3754752CA7FD839A09FFE53375FF2C981279FD4BC23A005458F7F5D +RUN Write-Host -NoNewLine ('Downloading {0} ... ' -f ${env:PY39}); \ + Invoke-WebRequest -Uri ${env:PY39} -OutFile python-3.9.13-amd64.exe; \ + Write-Host '✓'; \ + Write-Host -NoNewLine ('Verifying SHA256 ({0}) ... ' -f ${env:PY39_SHA256});\ + $Hash = Get-FileHash python-3.9.13-amd64.exe -Algorithm sha256; \ + if ($Hash.Hash -eq ${env:PY39_SHA256}) { \ + Write-Host '✓'; \ + } else { \ + Write-Host ('✘ ({0})' -f $Hash.Hash); \ + exit 1; \ + } \ + Write-Host -NoNewLine 'Installing Python ... '; \ + $Process = \ + Start-Process python-3.9.13-amd64.exe -Wait -PassThru -NoNewWindow -ArgumentList @( \ + 'AssociateFiles=0', \ + 'Include_doc=0', \ + 'Include_debug=0', \ + 'Include_lib=1', \ + 'Include_tcltk=0', \ + 'Include_test=0', \ + 'InstallAllUsers=1', \ + 'InstallLauncherAllUsers=0', \ + 'PrependPath=1', \ + '/quiet' \ + ); \ + if ($Process.ExitCode -eq 0) { \ + Write-Host '✓'; \ + } else { \ + Write-Host ('✘ ({0})' -f $Process.ExitCode); \ + exit 1; \ + } \ + Remove-Item -Force python-3.9.13-amd64.exe; \ + Remove-Item -ErrorAction SilentlyContinue -Force -Recurse ${env:TEMP}\* + +# Install Visual Studio Build Tools +ARG VSB=https://aka.ms/vs/17/release/vs_buildtools.exe +ARG VSB_SHA256=15A2A6591B1E91B63E9909864FCBC68459EB26124B814618947215F754CD9CEE +RUN Write-Host -NoNewLine ('Downloading {0} ... ' -f ${env:VSB}); \ + Invoke-WebRequest -Uri ${env:VSB} -OutFile vs_buildtools.exe; \ + Write-Host '✓'; \ + Write-Host -NoNewLine ('Verifying SHA256 ({0}) ... ' -f ${env:VSB_SHA256}); \ + $Hash = Get-FileHash vs_buildtools.exe -Algorithm sha256; \ + if ($Hash.Hash -eq ${env:VSB_SHA256}) { \ + Write-Host '✓'; \ + } else { \ + Write-Host ('✘ ({0})' -f $Hash.Hash); \ + } \ + Write-Host -NoNewLine 'Installing Visual Studio Build Tools ... '; \ + $Process = \ + Start-Process vs_buildtools.exe -Wait -PassThru -NoNewWindow -ArgumentList @( \ + '--quiet', \ + '--wait', \ + '--norestart', \ + '--nocache', \ + '--add', 'Microsoft.VisualStudio.Component.Windows11SDK.22000', \ + '--add', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64' \ + ); \ + if ($Process.ExitCode -eq 0 -or $Process.ExitCode -eq 3010) { \ + Write-Host '✓'; \ + } else { \ + Write-Host ('✘ ({0})' -f $Process.ExitCode); \ + exit 1; \ + } \ + Remove-Item -Force vs_buildtools.exe; \ + Remove-Item -ErrorAction SilentlyContinue -Force -Recurse ${env:TEMP}\* + +# Install Swift toolchain. +ARG SWIFT_RELEASE_METADATA=http://download.swift.org/swift-6.1-branch/windows10/latest-build.json +RUN $env:Release = curl.exe -sL ${env:SWIFT_RELEASE_METADATA}; \ + $env:SWIFT_URL = "\"https://download.swift.org/swift-6.1-branch/windows10/$($($env:Release | ConvertFrom-JSON).dir)/$($($env:Release | ConvertFrom-JSON).download)\""; \ + Write-Host -NoNewLine ('Downloading {0} ... ' -f ${env:SWIFT_URL}); \ + Invoke-WebRequest -Uri ${env:SWIFT_URL} -OutFile installer.exe; \ + Write-Host '✓'; \ + Write-Host -NoNewLine 'Installing Swift ... '; \ + $Process = \ + Start-Process installer.exe -Wait -PassThru -NoNewWindow -ArgumentList @( \ + '/quiet', \ + '/norestart' \ + ); \ + if ($Process.ExitCode -eq 0) { \ + Write-Host '✓'; \ + } else { \ + Write-Host ('✘ ({0})' -f $Process.ExitCode); \ + exit 1; \ + } \ + Remove-Item -Force installer.exe; \ + Remove-Item -ErrorAction SilentlyContinue -Force -Recurse ${env:TEMP}\* + +# FIXME: we should use a non-Administrator user +# USER ContainerUser +CMD ["powershell.exe", "-nologo", "-ExecutionPolicy", "Bypass"] diff --git a/nightly-6.1/windows/LTSC2022/Dockerfile b/nightly-6.1/windows/LTSC2022/Dockerfile new file mode 100644 index 00000000..bab3f9e2 --- /dev/null +++ b/nightly-6.1/windows/LTSC2022/Dockerfile @@ -0,0 +1,153 @@ +FROM mcr.microsoft.com/windows/servercore:ltsc2022 AS windows + +LABEL maintainer="Swift Infrastructure " +LABEL description="Docker Container for the Swift programming language" + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV PYTHONIOENCODING UTF-8 +ENV PYTHONUTF8=1 + +# Enable Developer Mode. +RUN reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1" +# Enable Long Paths +RUN reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem" /t REG_DWORD /f /v "LongPathsEnabled" /d "1" + +# Install Git. +# See: git-[version]-[bit].exe /SAVEINF=git.inf and /? +ARG GIT=https://github.com/git-for-windows/git/releases/download/v2.42.0.windows.2/Git-2.42.0.2-64-bit.exe +ARG GIT_SHA256=BD9B41641A258FD16D99BEECEC66132160331D685DFB4C714CEA2BCC78D63BDB +RUN Write-Host -NoNewLine ('Downloading {0} ... ' -f ${env:GIT}); \ + Invoke-WebRequest -Uri ${env:GIT} -OutFile git.exe; \ + Write-Host '✓'; \ + Write-Host -NoNewLine ('Verifying SHA256 ({0}) ... ' -f ${env:GIT_SHA256}); \ + $Hash = Get-FileHash git.exe -Algorithm sha256; \ + if ($Hash.Hash -eq ${env:GIT_SHA256}) { \ + Write-Host '✓'; \ + } else { \ + Write-Host ('✘ ({0})' -f $Hash.Hash); \ + exit 1; \ + } \ + Write-Host -NoNewLine 'Installing git ... '; \ + $Process = \ + Start-Process git.exe -Wait -PassThru -NoNewWindow -ArgumentList @( \ + '/SP-', \ + '/VERYSILENT', \ + '/SUPPRESSMSGBOXES', \ + '/NOCANCEL', \ + '/NORESTART', \ + '/CLOSEAPPLICATIONS', \ + '/FORCECLOSEAPPLICATIONS', \ + '/NOICONS', \ + '/COMPONENTS="gitlfs"', \ + '/EditorOption=VIM', \ + '/PathOption=Cmd', \ + '/SSHOption=OpenSSH', \ + '/CURLOption=WinSSL', \ + '/UseCredentialManager=Enabled', \ + '/EnableSymlinks=Enabled', \ + '/EnableFSMonitor=Enabled' \ + ); \ + if ($Process.ExitCode -eq 0) { \ + Write-Host '✓'; \ + } else { \ + Write-Host ('✘ ({0})' -f $Process.ExitCode); \ + exit 1; \ + } \ + Remove-Item -Force git.exe; \ + Remove-Item -ErrorAction SilentlyContinue -Force -Recurse ${env:TEMP}\* + +# Install Python +ARG PY39=https://www.python.org/ftp/python/3.9.13/python-3.9.13-amd64.exe +ARG PY39_SHA256=FB3D0466F3754752CA7FD839A09FFE53375FF2C981279FD4BC23A005458F7F5D +RUN Write-Host -NoNewLine ('Downloading {0} ... ' -f ${env:PY39}); \ + Invoke-WebRequest -Uri ${env:PY39} -OutFile python-3.9.13-amd64.exe; \ + Write-Host '✓'; \ + Write-Host -NoNewLine ('Verifying SHA256 ({0}) ... ' -f ${env:PY39_SHA256});\ + $Hash = Get-FileHash python-3.9.13-amd64.exe -Algorithm sha256; \ + if ($Hash.Hash -eq ${env:PY39_SHA256}) { \ + Write-Host '✓'; \ + } else { \ + Write-Host ('✘ ({0})' -f $Hash.Hash); \ + exit 1; \ + } \ + Write-Host -NoNewLine 'Installing Python ... '; \ + $Process = \ + Start-Process python-3.9.13-amd64.exe -Wait -PassThru -NoNewWindow -ArgumentList @( \ + 'AssociateFiles=0', \ + 'Include_doc=0', \ + 'Include_debug=0', \ + 'Include_lib=1', \ + 'Include_tcltk=0', \ + 'Include_test=0', \ + 'InstallAllUsers=1', \ + 'InstallLauncherAllUsers=0', \ + 'PrependPath=1', \ + '/quiet' \ + ); \ + if ($Process.ExitCode -eq 0) { \ + Write-Host '✓'; \ + } else { \ + Write-Host ('✘ ({0})' -f $Process.ExitCode); \ + exit 1; \ + } \ + Remove-Item -Force python-3.9.13-amd64.exe; \ + Remove-Item -ErrorAction SilentlyContinue -Force -Recurse ${env:TEMP}\* + +# Install Visual Studio Build Tools +ARG VSB=https://aka.ms/vs/17/release/vs_buildtools.exe +ARG VSB_SHA256=15A2A6591B1E91B63E9909864FCBC68459EB26124B814618947215F754CD9CEE +RUN Write-Host -NoNewLine ('Downloading {0} ... ' -f ${env:VSB}); \ + Invoke-WebRequest -Uri ${env:VSB} -OutFile vs_buildtools.exe; \ + Write-Host '✓'; \ + Write-Host -NoNewLine ('Verifying SHA256 ({0}) ... ' -f ${env:VSB_SHA256}); \ + $Hash = Get-FileHash vs_buildtools.exe -Algorithm sha256; \ + if ($Hash.Hash -eq ${env:VSB_SHA256}) { \ + Write-Host '✓'; \ + } else { \ + Write-Host ('✘ ({0})' -f $Hash.Hash); \ + } \ + Write-Host -NoNewLine 'Installing Visual Studio Build Tools ... '; \ + $Process = \ + Start-Process vs_buildtools.exe -Wait -PassThru -NoNewWindow -ArgumentList @( \ + '--quiet', \ + '--wait', \ + '--norestart', \ + '--nocache', \ + '--add', 'Microsoft.VisualStudio.Component.Windows11SDK.22000', \ + '--add', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64' \ + ); \ + if ($Process.ExitCode -eq 0 -or $Process.ExitCode -eq 3010) { \ + Write-Host '✓'; \ + } else { \ + Write-Host ('✘ ({0})' -f $Process.ExitCode); \ + exit 1; \ + } \ + Remove-Item -Force vs_buildtools.exe; \ + Remove-Item -ErrorAction SilentlyContinue -Force -Recurse ${env:TEMP}\* + +# Install Swift toolchain. +ARG SWIFT_RELEASE_METADATA=http://download.swift.org/swift-6.1-branch/windows10/latest-build.json +RUN $env:Release = curl.exe -sL ${env:SWIFT_RELEASE_METADATA}; \ + $env:SWIFT_URL = "\"https://download.swift.org/swift-6.1-branch/windows10/$($($env:Release | ConvertFrom-JSON).dir)/$($($env:Release | ConvertFrom-JSON).download)\""; \ + Write-Host -NoNewLine ('Downloading {0} ... ' -f ${env:SWIFT_URL}); \ + Invoke-WebRequest -Uri ${env:SWIFT_URL} -OutFile installer.exe; \ + Write-Host '✓'; \ + Write-Host -NoNewLine 'Installing Swift ... '; \ + $Process = \ + Start-Process installer.exe -Wait -PassThru -NoNewWindow -ArgumentList @( \ + '/quiet', \ + '/norestart' \ + ); \ + if ($Process.ExitCode -eq 0) { \ + Write-Host '✓'; \ + } else { \ + Write-Host ('✘ ({0})' -f $Process.ExitCode); \ + exit 1; \ + } \ + Remove-Item -Force installer.exe; \ + Remove-Item -ErrorAction SilentlyContinue -Force -Recurse ${env:TEMP}\* + +# FIXME: we should use a non-Administrator user +# USER ContainerUser +CMD ["powershell.exe", "-nologo", "-ExecutionPolicy", "Bypass"]