Skip to content

Image base variant + version and switching defaults #7

Description

@leighmcculloch

What problem does your feature solve?

There is no documented rule for how a maintainer should choose the Debian base used by the image. Today the Dockerfile hard-codes rust:${RUST_VERSION}-slim-bookworm in both the builder and runtime stages (and in the org.opencontainers.image.base.name label), but nothing in the repo says why slim and why bookworm, nor when to bump them.

That matters because both choices look like they should change:

slim — probably the wrong default.
The slim variant is intended for narrow use cases. The default rust:<version> image is based on buildpack-deps, which shares layers with a large number of other Docker images and is therefore likely already cached on most users' hosts. For a typical consumer, the default image is likely faster to pull, not slower, despite being larger on disk.

It also means we are manually installing packages in the builder stage that buildpack-deps already provides. From the current Dockerfile:

build-essential
ca-certificates
git
libdbus-1-dev
libssl-dev
libudev-dev
pkg-config

Of those, build-essential, ca-certificates, git, libssl-dev, and pkg-config are already present in buildpack-deps. Only libdbus-1-dev and libudev-dev would still need to be installed explicitly. (The runtime-stage installs are a separate question, since they install the runtime lib* packages, not -dev packages, and buildpack-deps is intended for build stages.)

bookworm — currently oldstable.
Debian 12 (bookworm) is now oldstable. Debian 13 (trixie) is the current stable. By default the image should target stable, as long as there is an Ubuntu LTS tracking the same Debian upstream (so users on Ubuntu LTS hosts are not running on a Debian that is newer than their host distro's upstream).

What would you like to see?

A short written rule in the repo covering:

  • Variant: default to the non-slim Rust image, since buildpack-deps layers are widely cached and remove the need for several of our manual apt-get installs.
  • Debian version: default to the Debian release that the latest Ubuntu LTS is based on. Per https://askubuntu.com/questions/445487/what-debian-version-are-the-different-ubuntu-versions-based-on, the current latest Ubuntu LTS is 26.04 (Resolute Raccoon, released April 2026), which maps onto Debian 13 (trixie).
  • Tag: keep the full Rust image name (including Debian variant and version, e.g. bookworm, slim-bookworm, trixie) in the published image tag, so older Debian versions remain buildable and addressable.

And update the current default to match.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions