diff --git a/nightly-main/fedora/41/Dockerfile b/nightly-main/fedora/41/Dockerfile new file mode 100644 index 000000000..7df85b13b --- /dev/null +++ b/nightly-main/fedora/41/Dockerfile @@ -0,0 +1,71 @@ +FROM fedora:41 +LABEL maintainer="Swift Infrastructure " +LABEL description="Docker Container for the Swift programming language" + +RUN yum -y install \ + binutils \ + gcc \ + git \ + gnupg2 \ + zip \ + unzip \ + curl \ + libcurl-devel \ + libedit-devel \ + libicu-devel \ + sqlite-devel \ + libuuid-devel \ + libxml2-devel \ + python3-devel \ + libstdc++-devel \ + libstdc++-static + +ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069 +ARG SWIFT_PLATFORM=fedora41 +ARG SWIFT_WEBROOT=https://download.swift.org/development +ARG SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM" + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_WEBROOT=$SWIFT_WEBROOT + +RUN echo "${SWIFT_WEBROOT}/latest-build.yml" + +RUN set -e; \ + ARCH_NAME="$(rpm --eval '%{_arch}')"; \ + case "${ARCH_NAME##*-}" in \ + 'x86_64') \ + OS_ARCH_SUFFIX=''; \ + ;; \ + 'aarch64') \ + OS_ARCH_SUFFIX='-aarch64'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ + esac; \ + export $(curl -s ${SWIFT_WEBROOT}${OS_ARCH_SUFFIX}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \ + && export $(curl -s ${SWIFT_WEBROOT}${OS_ARCH_SUFFIX}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \ + && export DOWNLOAD_DIR=$(echo $download | sed "s/-${SWIFT_PLATFORM}${OS_ARCH_SUFFIX}.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}${OS_ARCH_SUFFIX}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \ + ${SWIFT_WEBROOT}${OS_ARCH_SUFFIX}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \ + && curl -fSsL --compressed 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-main/fedora/41/buildx/Dockerfile b/nightly-main/fedora/41/buildx/Dockerfile new file mode 100644 index 000000000..e9395c366 --- /dev/null +++ b/nightly-main/fedora/41/buildx/Dockerfile @@ -0,0 +1,72 @@ +FROM fedora:41 AS base +LABEL maintainer="Swift Infrastructure " +LABEL description="Docker Container for the Swift programming language" + +RUN yum -y install \ + binutils \ + gcc \ + git \ + gnupg2 \ + zip \ + unzip \ + curl \ + libcurl-devel \ + libedit-devel \ + libicu-devel \ + sqlite-devel \ + libuuid-devel \ + libxml2-devel \ + python3-devel \ + libstdc++-devel \ + libstdc++-static + +ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069 +ARG SWIFT_PLATFORM=fedora41 +ARG SWIFT_WEBROOT=https://download.swift.org/development + +# This is a small trick to enable if/else for arm64 and amd64. +# Because of https://bugs.swift.org/browse/SR-14872 we need adjust tar options. +FROM base AS base-amd64 +ARG OS_ARCH_SUFFIX= + +FROM base AS base-arm64 +ARG OS_ARCH_SUFFIX=-aarch64 + +FROM base-$TARGETARCH AS final + +ARG PLATFORM_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM$OS_ARCH_SUFFIX" + +ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \ + SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_WEBROOT=$SWIFT_WEBROOT + +RUN echo "${PLATFORM_WEBROOT}/latest-build.yml" + +RUN set -e; \ + 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/-${SWIFT_PLATFORM}${OS_ARCH_SUFFIX}.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 --compressed 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