From cd8fc32f82bf1c96173fd7a0b018e94fbcbbe74b Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Mon, 16 Sep 2024 17:51:42 -0700 Subject: [PATCH] Add Swift 6.0 Dockerfiles to support Swift 6.0 release (#415) --- 6.0/amazonlinux/2/Dockerfile | 69 +++++++++++++ 6.0/amazonlinux/2/slim/Dockerfile | 49 ++++++++++ 6.0/debian/12/Dockerfile | 70 ++++++++++++++ 6.0/debian/12/slim/Dockerfile | 58 +++++++++++ 6.0/fedora/39/Dockerfile | 63 ++++++++++++ 6.0/fedora/39/slim/Dockerfile | 48 +++++++++ 6.0/rhel-ubi/9/Dockerfile | 63 ++++++++++++ 6.0/rhel-ubi/9/slim/Dockerfile | 48 +++++++++ 6.0/ubuntu/20.04/Dockerfile | 72 ++++++++++++++ 6.0/ubuntu/20.04/slim/Dockerfile | 58 +++++++++++ 6.0/ubuntu/22.04/Dockerfile | 73 ++++++++++++++ 6.0/ubuntu/22.04/slim/Dockerfile | 58 +++++++++++ 6.0/ubuntu/24.04/Dockerfile | 73 ++++++++++++++ 6.0/ubuntu/24.04/slim/Dockerfile | 59 +++++++++++ 6.0/windows/1809/Dockerfile | 156 ++++++++++++++++++++++++++++++ 6.0/windows/LTSC2022/Dockerfile | 156 ++++++++++++++++++++++++++++++ 16 files changed, 1173 insertions(+) create mode 100644 6.0/amazonlinux/2/Dockerfile create mode 100644 6.0/amazonlinux/2/slim/Dockerfile create mode 100644 6.0/debian/12/Dockerfile create mode 100644 6.0/debian/12/slim/Dockerfile create mode 100644 6.0/fedora/39/Dockerfile create mode 100644 6.0/fedora/39/slim/Dockerfile create mode 100644 6.0/rhel-ubi/9/Dockerfile create mode 100644 6.0/rhel-ubi/9/slim/Dockerfile create mode 100644 6.0/ubuntu/20.04/Dockerfile create mode 100644 6.0/ubuntu/20.04/slim/Dockerfile create mode 100644 6.0/ubuntu/22.04/Dockerfile create mode 100644 6.0/ubuntu/22.04/slim/Dockerfile create mode 100644 6.0/ubuntu/24.04/Dockerfile create mode 100644 6.0/ubuntu/24.04/slim/Dockerfile create mode 100644 6.0/windows/1809/Dockerfile create mode 100644 6.0/windows/LTSC2022/Dockerfile diff --git a/6.0/amazonlinux/2/Dockerfile b/6.0/amazonlinux/2/Dockerfile new file mode 100644 index 00000000..78e2f2d2 --- /dev/null +++ b/6.0/amazonlinux/2/Dockerfile @@ -0,0 +1,69 @@ +FROM amazonlinux:2 +LABEL maintainer="Swift Infrastructure " +LABEL description="Docker Container for the Swift programming language" + +RUN yum -y install \ + binutils \ + gcc \ + git \ + unzip \ + glibc-static \ + gzip \ + libbsd \ + libcurl-devel \ + libedit \ + libicu \ + libsqlite \ + libstdc++-static \ + libuuid \ + libxml2-devel \ + openssl-devel \ + tar \ + tzdata \ + zlib-devel + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# pub rsa4096 2024-09-16 [SC] [expires: 2026-09-16] +# 52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +# uid [ unknown] Swift 6.x Release Signing Key +ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +ARG SWIFT_PLATFORM=amazonlinux2 +ARG SWIFT_BRANCH=swift-6.0-release +ARG SWIFT_VERSION=swift-6.0-RELEASE +ARG SWIFT_WEBROOT=https://download.swift.org + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_BRANCH=$SWIFT_BRANCH \ + SWIFT_VERSION=$SWIFT_VERSION \ + SWIFT_WEBROOT=$SWIFT_WEBROOT + +RUN set -e; \ + ARCH_NAME="$(rpm --eval '%{_arch}')"; \ + url=; \ + case "${ARCH_NAME##*-}" in \ + 'x86_64') \ + OS_ARCH_SUFFIX=''; \ + ;; \ + 'aarch64') \ + OS_ARCH_SUFFIX='-aarch64'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ + esac; \ + SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \ + && SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \ + && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \ + && echo $SWIFT_BIN_URL \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \ + && gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \ + && gpg --batch --verify swift.tar.gz.sig swift.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && tar -xzf swift.tar.gz --directory / --strip-components=1 \ + && chmod -R o+r /usr/lib/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz + +# Print Installed Swift Version +RUN swift --version diff --git a/6.0/amazonlinux/2/slim/Dockerfile b/6.0/amazonlinux/2/slim/Dockerfile new file mode 100644 index 00000000..4d25a56c --- /dev/null +++ b/6.0/amazonlinux/2/slim/Dockerfile @@ -0,0 +1,49 @@ +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 + +# pub rsa4096 2024-09-16 [SC] [expires: 2026-09-16] +# 52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +# uid [ unknown] Swift 6.x Release Signing Key +ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +ARG SWIFT_PLATFORM=amazonlinux2 +ARG SWIFT_BRANCH=swift-6.0-release +ARG SWIFT_VERSION=swift-6.0-RELEASE +ARG SWIFT_WEBROOT=https://download.swift.org + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_BRANCH=$SWIFT_BRANCH \ + SWIFT_VERSION=$SWIFT_VERSION \ + SWIFT_WEBROOT=$SWIFT_WEBROOT + +RUN set -e; \ + ARCH_NAME="$(rpm --eval '%{_arch}')"; \ + url=; \ + case "${ARCH_NAME##*-}" in \ + 'x86_64') \ + OS_ARCH_SUFFIX=''; \ + ;; \ + 'aarch64') \ + OS_ARCH_SUFFIX='-aarch64'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ + esac; \ + SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \ + && SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \ + && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \ + && gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \ + && gpg --batch --verify swift.tar.gz.sig swift.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && yum -y install tar gzip \ + && tar -xzf swift.tar.gz --directory / --strip-components=1 \ + $SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/lib/swift/linux \ + $SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/libexec/swift/linux \ + && chmod -R o+r /usr/lib/swift /usr/libexec/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \ + && yum autoremove -y tar gzip diff --git a/6.0/debian/12/Dockerfile b/6.0/debian/12/Dockerfile new file mode 100644 index 00000000..cb7a13de --- /dev/null +++ b/6.0/debian/12/Dockerfile @@ -0,0 +1,70 @@ +FROM debian:12 + +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-gold \ + libicu-dev \ + libcurl4-openssl-dev \ + libedit-dev \ + libsqlite3-dev \ + libncurses-dev \ + libpython3-dev \ + libxml2-dev \ + pkg-config \ + uuid-dev \ + tzdata \ + git \ + gcc \ + && rm -r /var/lib/apt/lists/* + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# pub rsa4096 2024-09-16 [SC] [expires: 2026-09-16] +# 52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +# uid [ unknown] Swift 6.x Release Signing Key +ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +ARG SWIFT_PLATFORM=debian12 +ARG SWIFT_BRANCH=swift-6.0-release +ARG SWIFT_VERSION=swift-6.0-RELEASE +ARG SWIFT_WEBROOT=https://download.swift.org + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_BRANCH=$SWIFT_BRANCH \ + SWIFT_VERSION=$SWIFT_VERSION \ + SWIFT_WEBROOT=$SWIFT_WEBROOT + +RUN set -e; \ + ARCH_NAME="$(dpkg --print-architecture)"; \ + url=; \ + case "${ARCH_NAME##*-}" in \ + 'amd64') \ + OS_ARCH_SUFFIX=''; \ + ;; \ + 'arm64') \ + OS_ARCH_SUFFIX='-aarch64'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ + esac; \ + SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \ + && SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \ + && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \ + # - 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 gpg && rm -rf /var/lib/apt/lists/* \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \ + && gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \ + && gpg --batch --verify swift.tar.gz.sig swift.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && tar -xzf swift.tar.gz --directory / --strip-components=1 \ + && chmod -R o+r /usr/lib/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \ + && apt-get purge --auto-remove -y curl gpg + +# Print Installed Swift Version +RUN swift --version diff --git a/6.0/debian/12/slim/Dockerfile b/6.0/debian/12/slim/Dockerfile new file mode 100644 index 00000000..fe3982af --- /dev/null +++ b/6.0/debian/12/slim/Dockerfile @@ -0,0 +1,58 @@ +FROM debian:12 +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 + +# pub rsa4096 2024-09-16 [SC] [expires: 2026-09-16] +# 52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +# uid [ unknown] Swift 6.x Release Signing Key +ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +ARG SWIFT_PLATFORM=debian12 +ARG SWIFT_BRANCH=swift-6.0-release +ARG SWIFT_VERSION=swift-6.0-RELEASE +ARG SWIFT_WEBROOT=https://download.swift.org + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_BRANCH=$SWIFT_BRANCH \ + SWIFT_VERSION=$SWIFT_VERSION \ + SWIFT_WEBROOT=$SWIFT_WEBROOT + +RUN set -e; \ + ARCH_NAME="$(dpkg --print-architecture)"; \ + url=; \ + case "${ARCH_NAME##*-}" in \ + 'amd64') \ + OS_ARCH_SUFFIX=''; \ + ;; \ + 'arm64') \ + OS_ARCH_SUFFIX='-aarch64'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ + esac; \ + SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \ + && SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \ + && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \ + # - 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 gpg && rm -rf /var/lib/apt/lists/* \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \ + && gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \ + && gpg --batch --verify swift.tar.gz.sig swift.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && tar -xzf swift.tar.gz --directory / --strip-components=1 \ + $SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/lib/swift/linux \ + $SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/libexec/swift/linux \ + && chmod -R o+r /usr/lib/swift /usr/libexec/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \ + && apt-get purge --auto-remove -y curl gpg diff --git a/6.0/fedora/39/Dockerfile b/6.0/fedora/39/Dockerfile new file mode 100644 index 00000000..25e82348 --- /dev/null +++ b/6.0/fedora/39/Dockerfile @@ -0,0 +1,63 @@ +FROM fedora:39 + +LABEL maintainer="Swift Infrastructure " +LABEL description="Docker Container for the Swift programming language" + +RUN yum -y install \ + binutils \ + gcc \ + git \ + unzip \ + libcurl-devel \ + libedit-devel \ + libicu-devel \ + sqlite-devel \ + libuuid-devel \ + libxml2-devel \ + python3-devel + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# pub rsa4096 2024-09-16 [SC] [expires: 2026-09-16] +# 52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +# uid [ unknown] Swift 6.x Release Signing Key +ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +ARG SWIFT_PLATFORM=fedora39 +ARG SWIFT_BRANCH=swift-6.0-release +ARG SWIFT_VERSION=swift-6.0-RELEASE +ARG SWIFT_WEBROOT=https://download.swift.org + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_BRANCH=$SWIFT_BRANCH \ + SWIFT_VERSION=$SWIFT_VERSION \ + SWIFT_WEBROOT=$SWIFT_WEBROOT + +RUN set -e; \ + ARCH_NAME="$(rpm --eval '%{_arch}')"; \ + url=; \ + case "${ARCH_NAME##*-}" in \ + 'x86_64') \ + OS_ARCH_SUFFIX=''; \ + ;; \ + 'aarch64') \ + OS_ARCH_SUFFIX='-aarch64'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ + esac; \ + SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \ + && SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \ + && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \ + && echo $SWIFT_BIN_URL \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \ + && gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \ + && gpg --batch --verify swift.tar.gz.sig swift.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && tar -xzf swift.tar.gz --directory / --strip-components=1 \ + && chmod -R o+r /usr/lib/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz + +# Print Installed Swift Version +RUN swift --version diff --git a/6.0/fedora/39/slim/Dockerfile b/6.0/fedora/39/slim/Dockerfile new file mode 100644 index 00000000..3c359a01 --- /dev/null +++ b/6.0/fedora/39/slim/Dockerfile @@ -0,0 +1,48 @@ +FROM fedora:39 + +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 + +# pub rsa4096 2024-09-16 [SC] [expires: 2026-09-16] +# 52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +# uid [ unknown] Swift 6.x Release Signing Key +ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +ARG SWIFT_PLATFORM=fedora39 +ARG SWIFT_BRANCH=swift-6.0-release +ARG SWIFT_VERSION=swift-6.0-RELEASE +ARG SWIFT_WEBROOT=https://download.swift.org + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_BRANCH=$SWIFT_BRANCH \ + SWIFT_VERSION=$SWIFT_VERSION \ + SWIFT_WEBROOT=$SWIFT_WEBROOT + +RUN set -ex; \ + ARCH_NAME="$(rpm --eval '%{_arch}')"; \ + url=; \ + case "${ARCH_NAME##*-}" in \ + 'x86_64') \ + OS_ARCH_SUFFIX=''; \ + ;; \ + 'aarch64') \ + OS_ARCH_SUFFIX='-aarch64'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ + esac; \ + SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \ + && SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \ + && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \ + && gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \ + && gpg --batch --verify swift.tar.gz.sig swift.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && tar -xzf swift.tar.gz --directory / --strip-components=1 \ + $SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/lib/swift/linux \ + $SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/libexec/swift/linux \ + && chmod -R o+r /usr/lib/swift /usr/libexec/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz diff --git a/6.0/rhel-ubi/9/Dockerfile b/6.0/rhel-ubi/9/Dockerfile new file mode 100644 index 00000000..1b20c751 --- /dev/null +++ b/6.0/rhel-ubi/9/Dockerfile @@ -0,0 +1,63 @@ +FROM redhat/ubi9 +LABEL maintainer="Swift Infrastructure " +LABEL description="Docker Container for the Swift programming language" + +RUN yum -y install \ + 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 + +# pub rsa4096 2024-09-16 [SC] [expires: 2026-09-16] +# 52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +# uid [ unknown] Swift 6.x Release Signing Key +ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +ARG SWIFT_PLATFORM=ubi9 +ARG SWIFT_BRANCH=swift-6.0-release +ARG SWIFT_VERSION=swift-6.0-RELEASE +ARG SWIFT_WEBROOT=https://download.swift.org + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_BRANCH=$SWIFT_BRANCH \ + SWIFT_VERSION=$SWIFT_VERSION \ + SWIFT_WEBROOT=$SWIFT_WEBROOT + +RUN set -e; \ + ARCH_NAME="$(rpm --eval '%{_arch}')"; \ + url=; \ + case "${ARCH_NAME##*-}" in \ + 'x86_64') \ + OS_ARCH_SUFFIX=''; \ + ;; \ + 'aarch64') \ + OS_ARCH_SUFFIX='-aarch64'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ + esac; \ + SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \ + && SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \ + && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \ + && echo $SWIFT_BIN_URL \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \ + && gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \ + && gpg --batch --verify swift.tar.gz.sig swift.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && tar -xzf swift.tar.gz --directory / --strip-components=1 \ + && chmod -R o+r /usr/lib/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz + +# Print Installed Swift Version +RUN swift --version diff --git a/6.0/rhel-ubi/9/slim/Dockerfile b/6.0/rhel-ubi/9/slim/Dockerfile new file mode 100644 index 00000000..67780520 --- /dev/null +++ b/6.0/rhel-ubi/9/slim/Dockerfile @@ -0,0 +1,48 @@ +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 + +# pub rsa4096 2024-09-16 [SC] [expires: 2026-09-16] +# 52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +# uid [ unknown] Swift 6.x Release Signing Key +ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +ARG SWIFT_PLATFORM=ubi9 +ARG SWIFT_BRANCH=swift-6.0-release +ARG SWIFT_VERSION=swift-6.0-RELEASE +ARG SWIFT_WEBROOT=https://download.swift.org + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_BRANCH=$SWIFT_BRANCH \ + SWIFT_VERSION=$SWIFT_VERSION \ + SWIFT_WEBROOT=$SWIFT_WEBROOT + +RUN set -e; \ + ARCH_NAME="$(rpm --eval '%{_arch}')"; \ + url=; \ + case "${ARCH_NAME##*-}" in \ + 'x86_64') \ + OS_ARCH_SUFFIX=''; \ + ;; \ + 'aarch64') \ + OS_ARCH_SUFFIX='-aarch64'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ + esac; \ + SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \ + && SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \ + && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \ + && gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \ + && gpg --batch --verify swift.tar.gz.sig swift.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && yum -y install tar gzip \ + && tar -xzf swift.tar.gz --directory / --strip-components=1 \ + $SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/lib/swift/linux \ + $SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/libexec/swift/linux \ + && chmod -R o+r /usr/lib/swift /usr/libexec/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz diff --git a/6.0/ubuntu/20.04/Dockerfile b/6.0/ubuntu/20.04/Dockerfile new file mode 100644 index 00000000..8932e9cd --- /dev/null +++ b/6.0/ubuntu/20.04/Dockerfile @@ -0,0 +1,72 @@ +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 \ + 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 + +# pub rsa4096 2024-09-16 [SC] [expires: 2026-09-16] +# 52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +# uid [ unknown] Swift 6.x Release Signing Key +ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +ARG SWIFT_PLATFORM=ubuntu20.04 +ARG SWIFT_BRANCH=swift-6.0-release +ARG SWIFT_VERSION=swift-6.0-RELEASE +ARG SWIFT_WEBROOT=https://download.swift.org + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_BRANCH=$SWIFT_BRANCH \ + SWIFT_VERSION=$SWIFT_VERSION \ + SWIFT_WEBROOT=$SWIFT_WEBROOT + +RUN set -e; \ + ARCH_NAME="$(dpkg --print-architecture)"; \ + url=; \ + case "${ARCH_NAME##*-}" in \ + 'amd64') \ + OS_ARCH_SUFFIX=''; \ + ;; \ + 'arm64') \ + OS_ARCH_SUFFIX='-aarch64'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ + esac; \ + SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \ + && SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \ + && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \ + # - 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/* \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \ + && gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \ + && gpg --batch --verify swift.tar.gz.sig swift.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && tar -xzf swift.tar.gz --directory / --strip-components=1 \ + && chmod -R o+r /usr/lib/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \ + && apt-get purge --auto-remove -y curl + +# Print Installed Swift Version +RUN swift --version diff --git a/6.0/ubuntu/20.04/slim/Dockerfile b/6.0/ubuntu/20.04/slim/Dockerfile new file mode 100644 index 00000000..17a63e81 --- /dev/null +++ b/6.0/ubuntu/20.04/slim/Dockerfile @@ -0,0 +1,58 @@ +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 + +# pub rsa4096 2024-09-16 [SC] [expires: 2026-09-16] +# 52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +# uid [ unknown] Swift 6.x Release Signing Key +ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +ARG SWIFT_PLATFORM=ubuntu20.04 +ARG SWIFT_BRANCH=swift-6.0-release +ARG SWIFT_VERSION=swift-6.0-RELEASE +ARG SWIFT_WEBROOT=https://download.swift.org + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_BRANCH=$SWIFT_BRANCH \ + SWIFT_VERSION=$SWIFT_VERSION \ + SWIFT_WEBROOT=$SWIFT_WEBROOT + +RUN set -e; \ + ARCH_NAME="$(dpkg --print-architecture)"; \ + url=; \ + case "${ARCH_NAME##*-}" in \ + 'amd64') \ + OS_ARCH_SUFFIX=''; \ + ;; \ + 'arm64') \ + OS_ARCH_SUFFIX='-aarch64'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ + esac; \ + SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \ + && SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \ + && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \ + # - 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/* \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \ + && gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \ + && gpg --batch --verify swift.tar.gz.sig swift.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && tar -xzf swift.tar.gz --directory / --strip-components=1 \ + $SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/lib/swift/linux \ + $SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/libexec/swift/linux \ + && chmod -R o+r /usr/lib/swift /usr/libexec/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \ + && apt-get purge --auto-remove -y curl gnupg diff --git a/6.0/ubuntu/22.04/Dockerfile b/6.0/ubuntu/22.04/Dockerfile new file mode 100644 index 00000000..0b2e24db --- /dev/null +++ b/6.0/ubuntu/22.04/Dockerfile @@ -0,0 +1,73 @@ +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 \ + unzip \ + gnupg2 \ + libc6-dev \ + libcurl4-openssl-dev \ + libedit2 \ + libgcc-11-dev \ + libpython3-dev \ + libsqlite3-0 \ + libstdc++-11-dev \ + libxml2-dev \ + libz3-dev \ + pkg-config \ + python3-lldb-13 \ + tzdata \ + zlib1g-dev \ + && rm -r /var/lib/apt/lists/* + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# pub rsa4096 2024-09-16 [SC] [expires: 2026-09-16] +# 52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +# uid [ unknown] Swift 6.x Release Signing Key +ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +ARG SWIFT_PLATFORM=ubuntu22.04 +ARG SWIFT_BRANCH=swift-6.0-release +ARG SWIFT_VERSION=swift-6.0-RELEASE +ARG SWIFT_WEBROOT=https://download.swift.org + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_BRANCH=$SWIFT_BRANCH \ + SWIFT_VERSION=$SWIFT_VERSION \ + SWIFT_WEBROOT=$SWIFT_WEBROOT + +RUN set -e; \ + ARCH_NAME="$(dpkg --print-architecture)"; \ + url=; \ + case "${ARCH_NAME##*-}" in \ + 'amd64') \ + OS_ARCH_SUFFIX=''; \ + ;; \ + 'arm64') \ + OS_ARCH_SUFFIX='-aarch64'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ + esac; \ + SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \ + && SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \ + && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \ + # - 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/* \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \ + && gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \ + && gpg --batch --verify swift.tar.gz.sig swift.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && tar -xzf swift.tar.gz --directory / --strip-components=1 \ + && chmod -R o+r /usr/lib/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \ + && apt-get purge --auto-remove -y curl + +# Print Installed Swift Version +RUN swift --version diff --git a/6.0/ubuntu/22.04/slim/Dockerfile b/6.0/ubuntu/22.04/slim/Dockerfile new file mode 100644 index 00000000..eea17fd9 --- /dev/null +++ b/6.0/ubuntu/22.04/slim/Dockerfile @@ -0,0 +1,58 @@ +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 + +# pub rsa4096 2024-09-16 [SC] [expires: 2026-09-16] +# 52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +# uid [ unknown] Swift 6.x Release Signing Key +ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +ARG SWIFT_PLATFORM=ubuntu22.04 +ARG SWIFT_BRANCH=swift-6.0-release +ARG SWIFT_VERSION=swift-6.0-RELEASE +ARG SWIFT_WEBROOT=https://download.swift.org + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_BRANCH=$SWIFT_BRANCH \ + SWIFT_VERSION=$SWIFT_VERSION \ + SWIFT_WEBROOT=$SWIFT_WEBROOT + +RUN set -e; \ + ARCH_NAME="$(dpkg --print-architecture)"; \ + url=; \ + case "${ARCH_NAME##*-}" in \ + 'amd64') \ + OS_ARCH_SUFFIX=''; \ + ;; \ + 'arm64') \ + OS_ARCH_SUFFIX='-aarch64'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ + esac; \ + SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \ + && SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \ + && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \ + # - 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/* \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \ + && gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \ + && gpg --batch --verify swift.tar.gz.sig swift.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && tar -xzf swift.tar.gz --directory / --strip-components=1 \ + $SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/lib/swift/linux \ + $SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/libexec/swift/linux \ + && chmod -R o+r /usr/lib/swift /usr/libexec/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \ + && apt-get purge --auto-remove -y curl gnupg diff --git a/6.0/ubuntu/24.04/Dockerfile b/6.0/ubuntu/24.04/Dockerfile new file mode 100644 index 00000000..2a797520 --- /dev/null +++ b/6.0/ubuntu/24.04/Dockerfile @@ -0,0 +1,73 @@ +FROM ubuntu:24.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 \ + unzip \ + gnupg2 \ + libc6-dev \ + libcurl4-openssl-dev \ + libedit2 \ + libgcc-13-dev \ + libpython3-dev \ + libsqlite3-0 \ + libstdc++-13-dev \ + libxml2-dev \ + libncurses-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 + +# pub rsa4096 2024-09-16 [SC] [expires: 2026-09-16] +# 52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +# uid [ unknown] Swift 6.x Release Signing Key +ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +ARG SWIFT_PLATFORM=ubuntu24.04 +ARG SWIFT_BRANCH=swift-6.0-release +ARG SWIFT_VERSION=swift-6.0-RELEASE +ARG SWIFT_WEBROOT=https://download.swift.org + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_BRANCH=$SWIFT_BRANCH \ + SWIFT_VERSION=$SWIFT_VERSION \ + SWIFT_WEBROOT=$SWIFT_WEBROOT + +RUN set -e; \ + ARCH_NAME="$(dpkg --print-architecture)"; \ + url=; \ + case "${ARCH_NAME##*-}" in \ + 'amd64') \ + OS_ARCH_SUFFIX=''; \ + ;; \ + 'arm64') \ + OS_ARCH_SUFFIX='-aarch64'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ + esac; \ + SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \ + && SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \ + && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \ + # - 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/* \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \ + && gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \ + && gpg --batch --verify swift.tar.gz.sig swift.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && tar -xzf swift.tar.gz --directory / --strip-components=1 \ + && chmod -R o+r /usr/lib/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \ + && apt-get purge --auto-remove -y curl + +# Print Installed Swift Version +RUN swift --version diff --git a/6.0/ubuntu/24.04/slim/Dockerfile b/6.0/ubuntu/24.04/slim/Dockerfile new file mode 100644 index 00000000..c3c7fb1d --- /dev/null +++ b/6.0/ubuntu/24.04/slim/Dockerfile @@ -0,0 +1,59 @@ +FROM ubuntu:24.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 + +# pub rsa4096 2024-09-16 [SC] [expires: 2026-09-16] +# 52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +# uid [ unknown] Swift 6.x Release Signing Key +ARG SWIFT_SIGNING_KEY=52BB7E3DE28A71BE22EC05FFEF80A866B47A981F +ARG SWIFT_PLATFORM=ubuntu24.04 +ARG SWIFT_BRANCH=swift-6.0-release +ARG SWIFT_VERSION=swift-6.0-RELEASE +ARG SWIFT_WEBROOT=https://download.swift.org + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_BRANCH=$SWIFT_BRANCH \ + SWIFT_VERSION=$SWIFT_VERSION \ + SWIFT_WEBROOT=$SWIFT_WEBROOT + +RUN set -e; \ + ARCH_NAME="$(dpkg --print-architecture)"; \ + url=; \ + case "${ARCH_NAME##*-}" in \ + 'amd64') \ + OS_ARCH_SUFFIX=''; \ + ;; \ + 'arm64') \ + OS_ARCH_SUFFIX='-aarch64'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ + esac; \ + SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \ + && SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \ + && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \ + # - 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/* \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \ + && gpg --batch --quiet --keyserver keyserver.ubuntu.com --recv-keys "$SWIFT_SIGNING_KEY" \ + && gpg --batch --verify swift.tar.gz.sig swift.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && tar -xzf swift.tar.gz --directory / --strip-components=1 \ + $SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/lib/swift/linux \ + $SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/libexec/swift/linux \ + && chmod -R o+r /usr/lib/swift /usr/libexec/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \ + && apt-get purge --auto-remove -y curl gnupg diff --git a/6.0/windows/1809/Dockerfile b/6.0/windows/1809/Dockerfile new file mode 100644 index 00000000..d7d539d2 --- /dev/null +++ b/6.0/windows/1809/Dockerfile @@ -0,0 +1,156 @@ +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 + +# 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=D4E08524CB0E5BD061A24F507928D1CFB91DCE192C5E12ED964B8343FC4CDEDD +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=https://download.swift.org/swift-6.0-release/windows10/swift-6.0-RELEASE/swift-6.0-RELEASE-windows10.exe +ARG SWIFT_SHA256=0C6807B674B01B961DF87CD0DBE18D1ACDE93DC9A124DDE453BD6B597C1DB456 +RUN Write-Host -NoNewLine ('Downloading {0} ... ' -f ${env:SWIFT}); \ + Invoke-WebRequest -Uri ${env:SWIFT} -OutFile installer.exe; \ + Write-Host '✓'; \ + Write-Host -NoNewLine ('Verifying SHA256 ({0}) ... ' -f ${env:SWIFT_SHA256}); \ + $Hash = Get-FileHash installer.exe -Algorithm sha256; \ + if ($Hash.Hash -eq ${env:SWIFT_SHA256}) { \ + Write-Host '✓'; \ + } else { \ + Write-Host ('✘ ({0})' -f $Hash.Hash); \ + exit 1; \ + } \ + 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}\* + +# Default to powershell +# FIXME: we need to grant ContainerUser the SeCreateSymbolicLinkPrivilege +# privilege so that it can create symbolic links. +# USER ContainerUser +CMD ["powershell.exe", "-nologo", "-ExecutionPolicy", "Bypass"] diff --git a/6.0/windows/LTSC2022/Dockerfile b/6.0/windows/LTSC2022/Dockerfile new file mode 100644 index 00000000..aed3f058 --- /dev/null +++ b/6.0/windows/LTSC2022/Dockerfile @@ -0,0 +1,156 @@ +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 + +# 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=D4E08524CB0E5BD061A24F507928D1CFB91DCE192C5E12ED964B8343FC4CDEDD +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=https://download.swift.org/swift-6.0-release/windows10/swift-6.0-RELEASE/swift-6.0-RELEASE-windows10.exe +ARG SWIFT_SHA256=0C6807B674B01B961DF87CD0DBE18D1ACDE93DC9A124DDE453BD6B597C1DB456 +RUN Write-Host -NoNewLine ('Downloading {0} ... ' -f ${env:SWIFT}); \ + Invoke-WebRequest -Uri ${env:SWIFT} -OutFile installer.exe; \ + Write-Host '✓'; \ + Write-Host -NoNewLine ('Verifying SHA256 ({0}) ... ' -f ${env:SWIFT_SHA256}); \ + $Hash = Get-FileHash installer.exe -Algorithm sha256; \ + if ($Hash.Hash -eq ${env:SWIFT_SHA256}) { \ + Write-Host '✓'; \ + } else { \ + Write-Host ('✘ ({0})' -f $Hash.Hash); \ + exit 1; \ + } \ + 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}\* + +# Default to powershell +# FIXME: we need to grant ContainerUser the SeCreateSymbolicLinkPrivilege +# privilege so that it can create symbolic links. +# USER ContainerUser +CMD ["powershell.exe", "-nologo", "-ExecutionPolicy", "Bypass"]