Skip to content

feat: add ubuntu version-specific image tags#330

Merged
matifali merged 1 commit intomainfrom
matifali/ubuntu-version-tags
Apr 12, 2026
Merged

feat: add ubuntu version-specific image tags#330
matifali merged 1 commit intomainfrom
matifali/ubuntu-version-tags

Conversation

@matifali
Copy link
Copy Markdown
Member

@matifali matifali commented Apr 10, 2026

Summary

Adds Ubuntu version-specific image tags so users can pin to a specific Ubuntu release and avoid unexpected breakage when the base image changes.

Problem

The :ubuntu tag is rolling — it follows whatever Ubuntu version the Dockerfiles currently use. When we bump versions (e.g., 22.04 → 24.04), workspaces can break unexpectedly, as reported in #282.

Approach

Define UBUNTU_VERSION once in scripts/images.sh. Everything else reads that variable:

  • Dockerfiles consume it via ARG UBUNTU_VERSION in their FROM line
  • Build script passes it as --build-arg
  • Push script uses it directly to generate version-specific tags

No runtime detection, no sidecar files, no docker run at push time.

Changes

  • scripts/images.sh — Added UBUNTU_VERSION="noble" as the single source of truth
  • images/base/ubuntu.DockerfileFROM ubuntu:${UBUNTU_VERSION}
  • images/minimal/ubuntu.DockerfileFROM ubuntu:${UBUNTU_VERSION}
  • images/universal/ubuntu.DockerfileFROM mcr.microsoft.com/devcontainers/universal:${UBUNTU_VERSION}
  • scripts/build_images.sh — Passes --build-arg UBUNTU_VERSION
  • scripts/push_images.sh — Pushes ubuntu-{version} and ubuntu-{version}-{date} tags
  • README.md — Tag reference table
  • Derivative images (golang, java, node, desktop) unchanged — they inherit from locally-built base/minimal

Closes #282

🤖 This PR was created with the help of Coder Agents, and needs a human review. 🧑💻

@matifali matifali self-assigned this Apr 10, 2026
@matifali matifali force-pushed the matifali/ubuntu-version-tags branch from f4ce623 to 890cfcf Compare April 10, 2026 12:17
@matifali matifali marked this pull request as draft April 10, 2026 12:38
@matifali matifali force-pushed the matifali/ubuntu-version-tags branch from 890cfcf to 5d2743e Compare April 10, 2026 12:50
@matifali
Copy link
Copy Markdown
Member Author

@johnstcn, do you have better ideas to do this? For images where we control the Dockerfile, I was thinking we could use FROM ubuntu:<version>, but for the universal image, that wouldn't be possible, as we build on a 3rd-party base image we do not control.

@johnstcn
Copy link
Copy Markdown
Member

@johnstcn, do you have better ideas to do this? For images where we control the Dockerfile, I was thinking we could use FROM ubuntu:<version>, but for the universal image, that wouldn't be possible, as we build on a 3rd-party base image we do not control.

There is a set of tags we can reference here. We can't 100% rely on stability of those tags though (especially e.g. noble versus 5.1.4-noble). If we want 100% reliability we'd need to roll our own "universal" image.

The source of the universal devcontainer is available here though...

@matifali
Copy link
Copy Markdown
Member Author

matifali commented Apr 11, 2026

Yeah. That's a base image for the universal and then they add most tools via devcontainer features.

I will adjust it to relay in base image tags.

Define UBUNTU_VERSION in scripts/images.sh as a single source of truth.
Dockerfiles consume it via a build arg, and the push script reads the
same variable to generate version-specific tags. No runtime detection
or sidecar files needed.

Updated Dockerfiles to use ARG UBUNTU_VERSION:
- base, minimal: FROM ubuntu:${UBUNTU_VERSION}
- universal: FROM mcr.microsoft.com/devcontainers/universal:${UBUNTU_VERSION}
- Derivative images (golang, java, node, desktop) are unchanged since
  they inherit from locally-built base/minimal images.

New tags pushed per image:
- ubuntu-{version} (e.g., ubuntu-noble)
- ubuntu-{version}-{date} (e.g., ubuntu-noble-20250101)

Existing tags (ubuntu, ubuntu-{date}, latest) are unchanged.

Closes #282
@matifali matifali force-pushed the matifali/ubuntu-version-tags branch from 5d2743e to a97ebec Compare April 12, 2026 06:41
Copy link
Copy Markdown
Member Author

Updated. Let me know what you think now.

Copy link
Copy Markdown
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@matifali matifali marked this pull request as ready for review April 12, 2026 14:16
@matifali matifali merged commit 9216fbf into main Apr 12, 2026
2 checks passed
@matifali matifali deleted the matifali/ubuntu-version-tags branch April 12, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tag with ubuntu version

2 participants