Skip to content

docker: the base-image tag is not the toolchain pin - #49

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/rust-scratch-abi-soa-gsamge
Sep 7, 2026
Merged

AdaWorldAPI merged 1 commit into
mainfrom
claude/rust-scratch-abi-soa-gsamge

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Sep 7, 2026 •

Copy link
Copy Markdown
Owner

Fixes the Railway build:

failed to solve: docker.io/library/rust:1.98.1-slim-bookworm: not found

What was wrong

Both Dockerfiles used a single ARG RUST_VERSION=1.98.1 as both the toolchain version and the base-image tag. Measured against the registry:

result
rust:1.98.1-slim-bookworm 404 — does not exist
rust:1.98.0-slim-bookworm 200
rust:1.98-slim-bookworm 200
debian:bookworm-slim 200
static.rust-lang.org/dist/channel-rust-1.98.1.toml 200

So 1.98.1 is a real Rust release and the channel was always valid — what does not exist is a docker-library image for that patch. The official-images repo does not tag every point release. Conflating the two made a valid toolchain pin depend on whether someone happened to publish an image for it.

No fork of anything is required, and nothing is missing from Docker Hub that would need vendoring.

Diagnostic note (recorded in both files)

The failure reads confusingly. BuildKit resolves every stage's base in parallel, so the last line printed is often the healthy one:

[internal] load metadata for docker.io/library/debian:bookworm-slim

debian:bookworm-slim resolves fine — it is a red herring. Read the failed to solve: line, not the last load metadata line.

The fix

  • The base floats on the MINOR tag, ARG RUST_IMAGE_TAG=1.98-slim-bookworm, which docker-library always publishes.
  • The exact toolchain comes from rust-toolchain.toml, now COPY'd into the builder ahead of the sources with a rustup show to materialise it.

A second gap, found while fixing the first

rust-toolchain.toml was never copied into either image. A Railway build's toolchain was therefore whatever the base tag shipped, and the pin file had no effect on that path at all — the exact cross-file drift the file was added to end, still open on the one path nobody was checking. Its own header says it exists because the toolchain was previously carried "only as PROSE … the two Dockerfiles' ARG RUST_VERSION"; the Docker half of that was never actually closed.

Copying it first also means a pin bump invalidates the toolchain layer and nothing below it.

Consequence: bumping the toolchain is now a one-line edit in rust-toolchain.toml. RUST_IMAGE_TAG moves only when the MINOR does, and never to a patch-level tag — that is the shape that broke.

Cost, stated

The base tag resolves to 1.98.0 and rustup then installs 1.98.1 alongside it, so the builder stage carries two toolchains. The runtime stage is unchanged debian:bookworm-slim with only the stripped binary, so the shipped image is not affected.

⚠ Not built here

No Docker daemon in this environment (client only), so the image was not built. What is measured is real: the registry probes above, and rust-toolchain.toml still parsing to {channel: "1.98.1", components: ["rustfmt", "clippy"]}. Railway is the gate.

Branch note

claude/rust-scratch-abi-soa-gsamge's previous PR (#18) merged on 2026-08-04; the branch held only already-merged history (0 ahead, 67 behind), so it was restarted from main per the standing rule rather than stacking on merged commits.

🤖 Generated with Claude Code

https://claude.ai/code/session_011DN5odWu4eisdevH9bPWyz


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Improved Railway Docker builds by using an available Rust builder image.
    • Ensured builds consistently use the repository’s pinned Rust toolchain version.
    • Applied the same toolchain handling across both supported Railway builder configurations.
  • Documentation

    • Added release documentation clarifying the relationship between the Docker image version and the pinned Rust toolchain.

Railway build failed:

    failed to solve: docker.io/library/rust:1.98.1-slim-bookworm: not found

Both Dockerfiles used one `ARG RUST_VERSION=1.98.1` as BOTH the toolchain
version and the base-image tag. Measured against the registry: that tag is a
404, while `rust:1.98-slim-bookworm` and `rust:1.98.0-slim-bookworm` are 200,
and `static.rust-lang.org/dist/channel-rust-1.98.1.toml` is 200. So 1.98.1 is
a real Rust release and the CHANNEL was always valid -- what does not exist is
a docker-library IMAGE for that patch. Conflating the two made a valid pin
depend on whether someone tagged an image for it.

The base now floats on the MINOR tag (`ARG RUST_IMAGE_TAG=1.98-slim-bookworm`),
which docker-library always publishes.

The exact toolchain comes from rust-toolchain.toml, which is now COPY'd into
the builder ahead of the sources with a `rustup show` to materialise it. That
closes a separate gap found while fixing this one: the pin file was NEVER
copied into either image, so a Railway build's toolchain was whatever the base
tag shipped and the pin had no effect there at all -- the exact cross-file
drift that file was added to end, still open on the one path nobody checked.
Copying it first also means a pin bump invalidates the toolchain layer and
nothing below it.

Consequence: bumping the toolchain is now a one-line edit in
rust-toolchain.toml. `RUST_IMAGE_TAG` moves only when the MINOR does, and
never to a patch-level tag -- that is the shape that broke.

Diagnostic note recorded in both files: BuildKit resolves every stage's base
in parallel, so the last `load metadata` line printed is often the healthy one
(`debian:bookworm-slim`, which resolves fine). Read `failed to solve:`.

NOT BUILT HERE -- no Docker daemon in this environment (client only). The
registry probes above are real; the image build is not. Railway is the gate.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DN5odWu4eisdevH9bPWyz
@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 84885355-d3b4-4eef-a84b-b40f69c1e617

📥 Commits

Reviewing files that changed from the base of the PR and between 8b51487 and 9002d84.

📒 Files selected for processing (3)
  • Dockerfile.railway
  • Dockerfile.solid.railway
  • rust-toolchain.toml

📝 Walkthrough

Walkthrough

The Railway builders now use the available 1.98-slim-bookworm image tag and apply the repository’s exact Rust toolchain through rust-toolchain.toml. The toolchain file also documents this separation.

Changes

Rust builder alignment

Layer / File(s) Summary
Builder image tag configuration
Dockerfile.railway, Dockerfile.solid.railway
Both builders replace patch-level Rust image construction with the configurable RUST_IMAGE_TAG, defaulting to 1.98-slim-bookworm.
Repository toolchain loading
Dockerfile.railway, Dockerfile.solid.railway, rust-toolchain.toml
Both builders copy rust-toolchain.toml and run rustup show before dependency or source layers. The toolchain file documents the image tag and rustup channel distinction.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: claude

Poem

A rabbit checks the Rusty tower
The image tag blooms at the proper hour
The pinned toolchain hops in place
Two builders share the same clear trace
Builds proceed at bunny pace


Comment @coderabbitai help to get the list of available commands.

@cursor

cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_e3f3997e-e0dd-41dc-8bf3-04e81d2ff3c6)

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review September 7, 2026 04:11
@AdaWorldAPI
AdaWorldAPI merged commit 0f587ce into main Sep 7, 2026
4 of 5 checks passed
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.

2 participants