From 452c64be585ead08efa7ddbc18b82d7e4d087063 Mon Sep 17 00:00:00 2001 From: Kokoro Ibaragi Date: Wed, 24 Jan 2024 17:10:32 +0900 Subject: [PATCH 1/3] Add experimental Amazon Linux 2023 images support --- 5.7/amazonlinux/2023/Dockerfile | 67 ++++++++++++++++++++++++++++ 5.7/amazonlinux/2023/slim/Dockerfile | 49 ++++++++++++++++++++ 5.8/amazonlinux/2023/Dockerfile | 67 ++++++++++++++++++++++++++++ 5.8/amazonlinux/2023/slim/Dockerfile | 49 ++++++++++++++++++++ 5.9/amazonlinux/2023/Dockerfile | 67 ++++++++++++++++++++++++++++ 5.9/amazonlinux/2023/slim/Dockerfile | 51 +++++++++++++++++++++ 6 files changed, 350 insertions(+) create mode 100644 5.7/amazonlinux/2023/Dockerfile create mode 100644 5.7/amazonlinux/2023/slim/Dockerfile create mode 100644 5.8/amazonlinux/2023/Dockerfile create mode 100644 5.8/amazonlinux/2023/slim/Dockerfile create mode 100644 5.9/amazonlinux/2023/Dockerfile create mode 100644 5.9/amazonlinux/2023/slim/Dockerfile diff --git a/5.7/amazonlinux/2023/Dockerfile b/5.7/amazonlinux/2023/Dockerfile new file mode 100644 index 00000000..7b34cdb2 --- /dev/null +++ b/5.7/amazonlinux/2023/Dockerfile @@ -0,0 +1,67 @@ +FROM amazonlinux:2023 + +RUN dnf --allowerasing -y install \ + binutils \ + gcc \ + git \ + gnupg2-full \ + unzip \ + glibc-static \ + gzip \ + libbsd \ + libcurl-devel \ + libedit \ + libicu \ + libstdc++-static \ + libuuid \ + libxml2-devel \ + sqlite-libs \ + tar \ + tzdata \ + zlib-devel + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# pub 4096R/ED3D1561 2019-03-22 [SC] [expires: 2023-03-23] +# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561 +# uid Swift 5.x Release Signing Key &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/5.7/amazonlinux/2023/slim/Dockerfile b/5.7/amazonlinux/2023/slim/Dockerfile new file mode 100644 index 00000000..9933d01f --- /dev/null +++ b/5.7/amazonlinux/2023/slim/Dockerfile @@ -0,0 +1,49 @@ +FROM amazonlinux:2023 + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# pub 4096R/ED3D1561 2019-03-22 [SC] [expires: 2023-03-23] +# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561 +# uid Swift 5.x Release Signing Key &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 \ + && dnf -y swap gnupg2-minimal gnupg2-full \ + && 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. + && dnf -y install tar \ + && tar -xzf swift.tar.gz --directory / --strip-components=1 $SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/lib/swift/linux \ + && chmod -R o+r /usr/lib/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \ + && dnf -y swap gnupg2-full gnupg2-minimal \ + # - Disable removal protection for systemd that is not installed by default and relies on gzip. + && rm /etc/dnf/protected.d/systemd.conf \ + && dnf autoremove -y tar gzip systemd diff --git a/5.8/amazonlinux/2023/Dockerfile b/5.8/amazonlinux/2023/Dockerfile new file mode 100644 index 00000000..e8715d0f --- /dev/null +++ b/5.8/amazonlinux/2023/Dockerfile @@ -0,0 +1,67 @@ +FROM amazonlinux:2023 + +RUN dnf --allowerasing -y install \ + binutils \ + gcc \ + git \ + unzip \ + glibc-static \ + gnupg2-full \ + gzip \ + libbsd \ + libcurl-devel \ + libedit \ + libicu \ + libstdc++-static \ + libuuid \ + libxml2-devel \ + sqlite-libs \ + tar \ + tzdata \ + zlib-devel + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# pub 4096R/ED3D1561 2019-03-22 [SC] [expires: 2023-03-23] +# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561 +# uid Swift 5.x Release Signing Key &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/5.8/amazonlinux/2023/slim/Dockerfile b/5.8/amazonlinux/2023/slim/Dockerfile new file mode 100644 index 00000000..3a4e3924 --- /dev/null +++ b/5.8/amazonlinux/2023/slim/Dockerfile @@ -0,0 +1,49 @@ +FROM amazonlinux:2023 + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# pub 4096R/ED3D1561 2019-03-22 [SC] [expires: 2023-03-23] +# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561 +# uid Swift 5.x Release Signing Key &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 \ + && dnf -y swap gnupg2-minimal gnupg2-full \ + && 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. + && dnf -y install tar gzip \ + && tar -xzf swift.tar.gz --directory / --strip-components=1 $SWIFT_VERSION-$SWIFT_PLATFORM$OS_ARCH_SUFFIX/usr/lib/swift/linux \ + && chmod -R o+r /usr/lib/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \ + && dnf -y swap gnupg2-full gnupg2-minimal \ + # - Disable removal protection for systemd that is not installed by default and relies on gzip. + && rm /etc/dnf/protected.d/systemd.conf \ + && dnf autoremove -y tar gzip systemd diff --git a/5.9/amazonlinux/2023/Dockerfile b/5.9/amazonlinux/2023/Dockerfile new file mode 100644 index 00000000..bcfe5f61 --- /dev/null +++ b/5.9/amazonlinux/2023/Dockerfile @@ -0,0 +1,67 @@ +FROM amazonlinux:2023 + +RUN dnf --allowerasing -y install \ + binutils \ + gcc \ + git \ + unzip \ + glibc-static \ + gnupg2-full \ + gzip \ + libbsd \ + libcurl-devel \ + libedit \ + libicu \ + libstdc++-static \ + libuuid \ + libxml2-devel \ + tar \ + tzdata \ + sqlite-libs \ + zlib-devel + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# pub 4096R/ED3D1561 2019-03-22 [SC] [expires: 2023-03-23] +# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561 +# uid Swift 5.x Release Signing Key &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/5.9/amazonlinux/2023/slim/Dockerfile b/5.9/amazonlinux/2023/slim/Dockerfile new file mode 100644 index 00000000..2f472360 --- /dev/null +++ b/5.9/amazonlinux/2023/slim/Dockerfile @@ -0,0 +1,51 @@ +FROM amazonlinux:2023 + +# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little + +# pub 4096R/ED3D1561 2019-03-22 [SC] [expires: 2023-03-23] +# Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561 +# uid Swift 5.x Release Signing Key &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 \ + && dnf -y swap gnupg2-minimal gnupg2-full \ + && 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. + && dnf -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 \ + && dnf -y swap gnupg2-full gnupg2-minimal \ + # + && rm /etc/dnf/protect.d/systemd.conf \ + && dnf autoremove -y tar gzip systemd From 6c14d0d1ba0827da6cb7cada4c11bcd5d81e4ae7 Mon Sep 17 00:00:00 2001 From: Kokoro Ibaragi Date: Wed, 24 Jan 2024 17:30:18 +0900 Subject: [PATCH 2/3] Add experimental Amazon Linux 2023 images support * changes: Improve code aesthetics and comments --- 5.7/amazonlinux/2023/slim/Dockerfile | 2 +- 5.8/amazonlinux/2023/slim/Dockerfile | 2 +- 5.9/amazonlinux/2023/Dockerfile | 2 +- 5.9/amazonlinux/2023/slim/Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/5.7/amazonlinux/2023/slim/Dockerfile b/5.7/amazonlinux/2023/slim/Dockerfile index 9933d01f..e457a6d4 100644 --- a/5.7/amazonlinux/2023/slim/Dockerfile +++ b/5.7/amazonlinux/2023/slim/Dockerfile @@ -44,6 +44,6 @@ RUN set -e; \ && chmod -R o+r /usr/lib/swift \ && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \ && dnf -y swap gnupg2-full gnupg2-minimal \ - # - Disable removal protection for systemd that is not installed by default and relies on gzip. + # - Disable removal protection for the package systemd bundled with gnupg2-full. && rm /etc/dnf/protected.d/systemd.conf \ && dnf autoremove -y tar gzip systemd diff --git a/5.8/amazonlinux/2023/slim/Dockerfile b/5.8/amazonlinux/2023/slim/Dockerfile index 3a4e3924..a6843440 100644 --- a/5.8/amazonlinux/2023/slim/Dockerfile +++ b/5.8/amazonlinux/2023/slim/Dockerfile @@ -44,6 +44,6 @@ RUN set -e; \ && chmod -R o+r /usr/lib/swift \ && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \ && dnf -y swap gnupg2-full gnupg2-minimal \ - # - Disable removal protection for systemd that is not installed by default and relies on gzip. + # - Disable removal protection for the package systemd bundled with gnupg2-full. && rm /etc/dnf/protected.d/systemd.conf \ && dnf autoremove -y tar gzip systemd diff --git a/5.9/amazonlinux/2023/Dockerfile b/5.9/amazonlinux/2023/Dockerfile index bcfe5f61..70cd70ce 100644 --- a/5.9/amazonlinux/2023/Dockerfile +++ b/5.9/amazonlinux/2023/Dockerfile @@ -15,9 +15,9 @@ RUN dnf --allowerasing -y install \ libstdc++-static \ libuuid \ libxml2-devel \ + sqlite-libs \ tar \ tzdata \ - sqlite-libs \ zlib-devel # Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little diff --git a/5.9/amazonlinux/2023/slim/Dockerfile b/5.9/amazonlinux/2023/slim/Dockerfile index 2f472360..4c1bb9db 100644 --- a/5.9/amazonlinux/2023/slim/Dockerfile +++ b/5.9/amazonlinux/2023/slim/Dockerfile @@ -46,6 +46,6 @@ RUN set -e; \ && chmod -R o+r /usr/lib/swift /usr/libexec/swift \ && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \ && dnf -y swap gnupg2-full gnupg2-minimal \ - # + # - Disable removal protection for the package systemd bundled with gnupg2-full. && rm /etc/dnf/protect.d/systemd.conf \ && dnf autoremove -y tar gzip systemd From 6354519223b1b72ad9610e43473b38e36b9819f2 Mon Sep 17 00:00:00 2001 From: Kokoro Ibaragi Date: Wed, 24 Jan 2024 17:47:08 +0900 Subject: [PATCH 3/3] Add experimental Amazon Linux 2023 images support * changes: fix typos in path --- 5.9/amazonlinux/2023/slim/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.9/amazonlinux/2023/slim/Dockerfile b/5.9/amazonlinux/2023/slim/Dockerfile index 4c1bb9db..271b313e 100644 --- a/5.9/amazonlinux/2023/slim/Dockerfile +++ b/5.9/amazonlinux/2023/slim/Dockerfile @@ -47,5 +47,5 @@ RUN set -e; \ && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \ && dnf -y swap gnupg2-full gnupg2-minimal \ # - Disable removal protection for the package systemd bundled with gnupg2-full. - && rm /etc/dnf/protect.d/systemd.conf \ + && rm /etc/dnf/protected.d/systemd.conf \ && dnf autoremove -y tar gzip systemd