engineering

Check whether a runtime image ships build tools

Inventory a final runtime image for compilers, package tools and development dependencies that were intended to stay in the build stage.

TrustIvan · · 5 min read

A builder image needs a compiler to produce a small runtime application. Its final image is supposed to contain just the app and runtime libraries, but the inventory includes a shell and a package tool borrowed from the chosen runtime base. In this fictional review, identify what actually ships and agree which tools the runtime needs.

Inspect the final image by platform

Observed componentBuilderFinal artifact
CompilerUsed in approved build stageExpected absent
Package toolUsed for build inputsPresent from runtime base
Diagnostic shellAvailable for test workPresent pending owner review

Resolve the production output and its child manifests if applicable. Record the scan or inspection scope and expected runtime tools. Review OS packages, copied binaries and application bundles where those paths matter. A final package inventory can omit files with no package-manager owner.

Read the identity from the artifact

Compare the build output with what the runtime or release system resolved. A source commit identifies inputs, a build run identifies execution, and a digest identifies particular bytes. The link among those records is useful in both directions. Someone starting with a runtime observation should be able to find the build that produced it, and someone starting with a build should know which target currently uses it. Record the platform alongside the digest for any image that publishes an index. A report on one manifest does not establish what another platform would run.

Start by looking at the artifact-specific package and file inventory for the platform you deploy. Identify any build tools, development modules or package caches expected to be absent. Trace unexpected files back to the parent image or copy step before changing the build. Some services compile plugins at runtime and depend on a tool that others can remove.

After the build change, verify the replacement inventory and run an approved application smoke test against the final image. In an evaluation, compare scanners on whether their reports identify the location and origin of such files. The multi-stage build verification guide covers following a file through the build.

Inspect both a normal final image and a harmless fixture with an additional diagnostic binary copied through a build stage. Verify that the artifact review observes the unexpected file. Compare any platform variants that use different runtime bases. The owner can then determine whether a difference is intentional and how it should be reviewed.

Compare runtime and builder contents

Save the builder and final artifact inventories side by side for an approved image. Use the final subject to check explicit file placement for the diagnostic binary, and observe whether the runtime package manager can account for it. A tool copied between stages can appear only in the file view. Compare that with the package tool inherited from the runtime base. The build owner can now decide whether to revise the final stage or choose a different supported base. Run normal startup and approved diagnostics again after the adjustment.

Before changing contents, ask the application team which approved diagnostic or operational functions must still work. Use normal staging tests for startup, health and recovery. Give intended runtime tooling an explicit purpose where policy needs justification, including any alternate tool the team plans to use.

Use one authorized rehearsal to give the image build owner a control case and one incomplete evidence record. Keep the subject stable while the observation changes. Capture when the source event occurred and when it became available to the reviewer. Verify the event recorded in the final image inspection record has enough context to tell the two cases apart after the original operator has left the shift. A reviewer should be able to describe why the incomplete result is still pending.

Decide which tools are justified

Give the reviewer the release target and the intact reference to the artifact record. Use the shorter labels from the example for discussion and the full identifiers for a calculation or machine comparison. Retain the platform observation with the report because a result can be valid for its manifest while the rollout uses a different one. For a release that needs more than one platform, require evidence for each platform in scope before making a claim about the whole release. Make pending rollout and pending inspection explicit so the follow-up lands with the person who can complete it.

Keep the inventory evidence attached to the tested digest and deployment record. Confirm a new runtime artifact has the intended contents before closing the finding. The next image build should receive the same review if the base or final stage changes.

Include a record that arrives after the scheduled review. Preserve the original review snapshot and attach the late event when it becomes available. Then check whether the next owner can explain what they knew at each point.

In an escalation, send the active owner the decision being requested and the source they can consult. Give them one record to confirm and a date for responding. This keeps follow-up anchored to a reviewable observation instead of a broad request to take another look.

When a detected executable has unknown origin, give the build owner its observed path and artifact reference. Reviewing the exact final image can distinguish a dependency of the base from an intentional stage transfer.