docker: install cargo-deny as a pinned prebuilt binary#175
Merged
Conversation
The dev images built cargo-deny from source via `cargo install cargo-deny`.
That compiled cargo-deny on every image build (multi-minute) and surfaced
cargo-deny's own `profile.dev.package.{insta,similar}` warnings, which look
like our config but are not.
Install the pinned (0.19.8), checksum-verified prebuilt binary instead. The
static musl build runs on glibc too, so all three images share one asset.
Result: no source compile, no spurious warnings, and a reproducible,
sha256-verified install (vs the previous unpinned `cargo install`). Each
build self-checks with `cargo-deny --version`.
Version/checksum are ARGs so they can be bumped (and tracked by Renovate).
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the development Docker images to install cargo-deny from a pinned, checksum-verified prebuilt release artifact rather than compiling it from source during image builds. This improves build time and avoids cargo-deny’s own profile warning noise that appears when installing from source via cargo install.
Changes:
- Replace
cargo install cargo-denywith a pinnedcargo-denyrelease download + SHA256 verification. - Use the static
x86_64-unknown-linux-muslartifact across Debian, Alpine, and Fedora images. - Add a self-check (
cargo-deny --version) during build to validate the installed binary.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| docker/Dockerfile.fedora | Downloads and installs pinned, checksum-verified cargo-deny binary into /root/.cargo/bin. |
| docker/Dockerfile.debian | Downloads and installs pinned, checksum-verified cargo-deny binary into /usr/local/cargo/bin. |
| docker/Dockerfile.alpine | Downloads and installs pinned, checksum-verified cargo-deny binary into /usr/local/cargo/bin. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The dev images built cargo-deny from source (
cargo install cargo-deny). That recompiled it on every image build (several minutes ×3) and surfaced cargo-deny's ownprofile.dev.package.{insta,similar}warnings during the build:Those look like our config but aren't — they're in cargo-deny's Cargo.toml (insta is its snapshot-test dep), emitted because
cargo installresolves without dev-deps.Change
Install the pinned, checksum-verified prebuilt cargo-deny binary instead (all three Dockerfiles). The static-musl build runs on glibc too, so one asset serves debian/alpine/fedora.
ARG(Renovate-trackable) — an improvement over the previous unpinnedcargo install.cargo-deny --version.Validation
Built all three images locally — debian (glibc), alpine (musl/busybox), fedora (glibc/dnf):
/tmp/cargo-deny.tar.gz: OK(checksum) on eachcargo-deny 0.19.8runs on each (confirms the static binary works across libc)insta/similarwarnings are goneNote: the CI
Cargo Denygate usesEmbarkStudios/cargo-deny-actionand is unaffected; this only changes the local/dev Docker images.