Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ RUN cargo build --release

FROM alpine:3.23

# Install CA certificates for HTTPS
RUN apk add --no-cache ca-certificates
# Install runtime tools:
# - ca-certificates for HTTPS
# - jq/yq-go for Kubernetes-oriented config processing workflows
RUN apk add --no-cache ca-certificates jq yq-go

COPY --from=builder /app/target/release/rc /usr/bin/rc
COPY --from=builder /app/LICENSE-* /licenses/
Expand Down
30 changes: 30 additions & 0 deletions crates/cli/tests/dockerfile_contract.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//! Contract tests for Dockerfile runtime image tooling guarantees.

#[test]
fn runtime_image_contains_jq_and_yq() {
Comment on lines +3 to +4
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

For consistency with the other crates/cli/tests/* contract/golden/integration test files, consider adding a brief module-level //! doc comment describing what this contract test is protecting (and why it exists).

Copilot uses AI. Check for mistakes.
let dockerfile = include_str!("../../../Dockerfile");
let runtime_section = dockerfile
.split("FROM alpine:3.23")
.nth(1)
.expect("Dockerfile must contain runtime stage based on alpine:3.23");
let runtime_apk_line = runtime_section
.lines()
.find(|line| line.contains("apk add --no-cache"))
.expect("runtime stage must install packages via `apk add --no-cache`");

let mut has_jq = false;
let mut has_yq_go = false;

for token in runtime_apk_line.split_whitespace() {
if token == "jq" {
has_jq = true;
} else if token == "yq-go" {
has_yq_go = true;
}
}

assert!(
has_jq && has_yq_go,
"runtime image must install jq and yq-go"
);
}