Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ under the `ubuntu` tag.

Each image is published with the following tag variants:

| Tag | Example | Description |
| ------------------------- | --------------------------------------------- | -------------------------------------------------- |
| `ubuntu` | `codercom/example-base:ubuntu` | Latest Ubuntu version (rolling) |
| `ubuntu-{version}` | `codercom/example-base:ubuntu-noble` | Pinned to a specific Ubuntu release |
| `ubuntu-{date}` | `codercom/example-base:ubuntu-20250101` | Snapshot from a specific build date |
| `ubuntu-{version}-{date}` | `codercom/example-base:ubuntu-noble-20250101` | Version-pinned snapshot from a specific build date |
| `latest` | `codercom/example-base:latest` | Alias for the latest build |
| Tag | Example | Description |
| ------------------------- | ------------------------------------------------ | -------------------------------------------------- |
| `ubuntu` | `codercom/example-base:ubuntu` | Latest Ubuntu version (rolling) |
| `ubuntu-{version}` | `codercom/example-base:ubuntu-resolute` | Pinned to a specific Ubuntu release |
| `ubuntu-{date}` | `codercom/example-base:ubuntu-20250101` | Snapshot from a specific build date |
| `ubuntu-{version}-{date}` | `codercom/example-base:ubuntu-resolute-20250101` | Version-pinned snapshot from a specific build date |
| `latest` | `codercom/example-base:latest` | Alias for the latest build |

> For backward compatibility, these images are also available with the `enterprise-` prefix
> (e.g., `codercom/enterprise-base`), but the `example-` prefix is recommended for new deployments.
Expand Down
2 changes: 1 addition & 1 deletion images/base/docker.list
Original file line number Diff line number Diff line change
@@ -1 +1 @@
deb [signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu noble stable
deb [signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu resolute stable
2 changes: 1 addition & 1 deletion images/base/ubuntu.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG UBUNTU_VERSION=noble
ARG UBUNTU_VERSION=resolute
FROM ubuntu:${UBUNTU_VERSION}

SHELL ["/bin/bash", "-c"]
Expand Down
2 changes: 1 addition & 1 deletion images/minimal/ubuntu.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG UBUNTU_VERSION=noble
ARG UBUNTU_VERSION=resolute
FROM ubuntu:${UBUNTU_VERSION}

USER root
Expand Down
3 changes: 3 additions & 0 deletions images/universal/ubuntu.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# UBUNTU_VERSION is pinned to noble via UBUNTU_VERSION_OVERRIDES in
# scripts/images.sh because Microsoft's devcontainers/universal image does
# not yet publish a resolute (26.04) tag. See coder/images#335.
ARG UBUNTU_VERSION=noble
FROM mcr.microsoft.com/devcontainers/universal:${UBUNTU_VERSION}

Expand Down
2 changes: 1 addition & 1 deletion scripts/build_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ for image in "${IMAGES[@]}"; do
fi

run_trace $DRY_RUN depot build --project "gb3p8xrshk" --load --platform "$platform" --save --metadata-file="build_${image}.json" \
--build-arg "UBUNTU_VERSION=$UBUNTU_VERSION" \
--build-arg "UBUNTU_VERSION=$(ubuntu_version_for "$image")" \
"${docker_flags[@]}" \
"$image_dir" \
--file="$image_path" \
Expand Down
20 changes: 19 additions & 1 deletion scripts/images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,25 @@ set -euo pipefail
# images. Changing this value and rebuilding will produce images on
# a different Ubuntu release. All Dockerfiles and the push script
# read this variable so it acts as a single source of truth.
UBUNTU_VERSION="noble"
UBUNTU_VERSION="resolute"

# UBUNTU_VERSION_OVERRIDES pins individual images to a different Ubuntu
# release than the default UBUNTU_VERSION above. It drives both the build
# arg and the version-specific push tags, so an overridden image is tagged
# with the release it is actually built from rather than the default.
#
# universal is pinned to noble because Microsoft's devcontainers/universal
# image does not yet publish a resolute (26.04) tag. See coder/images#335.
declare -A UBUNTU_VERSION_OVERRIDES=(
["universal"]="noble"
)

# ubuntu_version_for prints the Ubuntu release for the given image, using an
# override when present and falling back to the default UBUNTU_VERSION.
ubuntu_version_for() {
local image="$1"
echo "${UBUNTU_VERSION_OVERRIDES[$image]:-$UBUNTU_VERSION}"
}

# IMAGES defines the list of images to build/push IN ORDER.
IMAGES=(
Expand Down
10 changes: 6 additions & 4 deletions scripts/push_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,12 @@ for image in "${IMAGES[@]}"; do
run_trace $DRY_RUN depot push --project "gb3p8xrshk" --tag "codercom/enterprise-${image}:latest" "$build_id"

# Push version-specific tags so users can pin to a specific Ubuntu
# release. UBUNTU_VERSION is defined in images.sh and is the single
# source of truth used by both the Dockerfiles and this script.
# release. The version comes from images.sh (the single source of
# truth) via ubuntu_version_for, which honours per-image overrides so
# each image is tagged with the release it is actually built from.
image_ubuntu_version="$(ubuntu_version_for "$image")"
for prefix in "example" "enterprise"; do
run_trace $DRY_RUN depot push --project "gb3p8xrshk" --tag "codercom/${prefix}-${image}:${TAG}-${UBUNTU_VERSION}" "$build_id"
run_trace $DRY_RUN depot push --project "gb3p8xrshk" --tag "codercom/${prefix}-${image}:${TAG}-${UBUNTU_VERSION}-${date_str}" "$build_id"
run_trace $DRY_RUN depot push --project "gb3p8xrshk" --tag "codercom/${prefix}-${image}:${TAG}-${image_ubuntu_version}" "$build_id"
run_trace $DRY_RUN depot push --project "gb3p8xrshk" --tag "codercom/${prefix}-${image}:${TAG}-${image_ubuntu_version}-${date_str}" "$build_id"
done
done