Skip to content

Commit e33f646

Browse files
feat(templates): add AL2023 2025-12-08's image
This commit adds a simple template for the Amazon Linux 2023 operating system's 2025-12-08 version. The OS is scheduled to release every two weeks, therefore, a new script called hack/update-template-amazonlinux-2023.sh is added next to the other template updater scripts. Find the latest images here: - https://cdn.amazonlinux.com/al2023/os-images/latest/ Signed-off-by: Gyokhan Kochmarla <[email protected]>
1 parent b18eed7 commit e33f646

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
SETUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6+
TEMPLATE_FILE="${SETUP_DIR}/../templates/experimental/amazonlinux-2023.yaml"
7+
8+
# Get the latest release version from the CDN redirect
9+
distribution_release_al2023=$(basename "$(curl -Ls -o /dev/null -w %{url_effective} https://cdn.amazonlinux.com/al2023/os-images/latest/)")
10+
11+
echo "Latest Release: ${distribution_release_al2023}"
12+
13+
# Function to get URL and Digest
14+
function get_image_details() {
15+
local arch="$1"
16+
local folder="$2" # kvm or kvm-arm64
17+
local base_url="https://cdn.amazonlinux.com/al2023/os-images/${distribution_release_al2023}/${folder}"
18+
19+
local checksums
20+
checksums=$(curl -Ls "${base_url}/SHA256SUMS")
21+
22+
local filename
23+
filename=$(echo "${checksums}" | awk '{print $2}')
24+
local digest
25+
digest=$(echo "${checksums}" | awk '{print $1}')
26+
27+
echo "${base_url}/${filename} ${digest}"
28+
}
29+
30+
# Get x86_64 details
31+
read -r url_amd64 digest_amd64 <<< "$(get_image_details "x86_64" "kvm")"
32+
echo "x86_64: ${url_amd64} ${digest_amd64}"
33+
34+
# Get aarch64 details
35+
read -r url_arm64 digest_arm64 <<< "$(get_image_details "aarch64" "kvm-arm64")"
36+
echo "aarch64: ${url_arm64} ${digest_arm64}"
37+
38+
sed -i.bak \
39+
-e "s|location: \".*kvm/.*\"|location: \"${url_amd64}\"|" \
40+
-e "/arch: \"x86_64\"/{n;s|digest: \".*\"|digest: \"sha256:${digest_amd64}\"|;}" \
41+
-e "s|location: \".*kvm-arm64/.*\"|location: \"${url_arm64}\"|" \
42+
-e "/arch: \"aarch64\"/{n;s|digest: \".*\"|digest: \"sha256:${digest_arm64}\"|;}" \
43+
"${TEMPLATE_FILE}"
44+
45+
# Update message
46+
sed -i.bak \
47+
-e "s|Amazon Linux 2023 (.*)|Amazon Linux 2023 (${distribution_release_al2023})|" \
48+
"${TEMPLATE_FILE}"
49+
50+
rm "${TEMPLATE_FILE}.bak"
51+
52+
echo "Updated ${TEMPLATE_FILE}"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
minimumLimaVersion: 2.0.0
2+
3+
images:
4+
- location: "https://cdn.amazonlinux.com/al2023/os-images/2023.9.20251208.0/kvm/al2023-kvm-2023.9.20251208.0-kernel-6.1-x86_64.xfs.gpt.qcow2"
5+
arch: "x86_64"
6+
digest: "sha256:c91f244483d9a460869738f7fcfb5e37eb402aec8582d10456cf0c108e1a4d4c"
7+
- location: "https://cdn.amazonlinux.com/al2023/os-images/2023.9.20251208.0/kvm-arm64/al2023-kvm-2023.9.20251208.0-kernel-6.1-arm64.xfs.gpt.qcow2"
8+
arch: "aarch64"
9+
digest: "sha256:7aef1f189076a0416cd16062bbf7e0928d81061e68411cab8904447e1bd5eafd"
10+
11+
# reverse-sshfs & 9p are unsupported mount types.
12+
mountTypesUnsupported: [9p, reverse-sshfs]
13+
mountType: "virtiofs"
14+
mounts:
15+
- location: "~"
16+
17+
# Do not install containerd by default.
18+
containerd:
19+
system: false
20+
user: false
21+
22+
message: |
23+
####################################################
24+
Amazon Linux 2023 (2023.9.20251208.0)
25+
26+
To update the latest Amazon Linux 2023 release, run:
27+
$ sudo dnf upgrade --releasever=latest
28+
####################################################

0 commit comments

Comments
 (0)