Skip to content

Commit

Permalink
pin docker img digest
Browse files Browse the repository at this point in the history
  • Loading branch information
tchapacan authored and drkaine committed Nov 4, 2024
1 parent e35ead2 commit ef07fed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
FROM --platform=$BUILDPLATFORM rust:bookworm as vendor
# bookworm
FROM --platform=$BUILDPLATFORM rust:bookworm@sha256:33a0ea4769482be860174e1139c457bdcb2a236a988580a28c3a48824cbc17d6 as vendor
ARG BUILDPLATFORM
ARG TARGETPLATFORM
WORKDIR /app
COPY ./Cargo.toml .
COPY ./src src
RUN mkdir .cargo && cargo vendor > .cargo/config.toml

FROM rust:bookworm as builder
# bookworm
FROM rust:bookworm@sha256:33a0ea4769482be860174e1139c457bdcb2a236a988580a28c3a48824cbc17d6 as builder
WORKDIR /app

COPY --from=vendor /app/.cargo .cargo
Expand All @@ -15,7 +17,8 @@ COPY ./Cargo.toml .
COPY ./src src
RUN cargo build --release

FROM debian:bookworm-slim
# bookworm-slim
FROM debian:bookworm-slim@sha256:36e591f228bb9b99348f584e83f16e012c33ba5cad44ef5981a1d7c0a93eca22
WORKDIR /app
ENV RUST_BACKTRACE=full
COPY --from=builder /app/target/release/livebox-exporter-rs livebox-exporter-rs
Expand Down
6 changes: 3 additions & 3 deletions example/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
livebox-exporter-rs:
image: tchapacan/livebox-exporter-rs
image: tchapacan/livebox-exporter-rs:v0.1.2@sha256:04521ff32fce062b78ef7fad64cd6b2fed024e518245fb2a48970c96b3a1ffe8 # v0.1.2
container_name: livebox-exporter-rs
command:
- "-P"
Expand All @@ -14,7 +14,7 @@ services:
- LIVEBOX_PASSWORD

prometheus:
image: prom/prometheus
image: prom/prometheus:v2.55.0@sha256:378f4e03703557d1c6419e6caccf922f96e6d88a530f7431d66a4c4f4b1000fe # v2.55.0
container_name: prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
Expand All @@ -28,7 +28,7 @@ services:
- monitoring_network

grafana:
image: grafana/grafana
image: grafana/grafana:v11.3.0@sha256:a0f881232a6fb71a0554a47d0fe2203b6888fe77f4cefb7ea62bed7eb54e13c3 # v11.3.0
container_name: grafana
ports:
- 3000:3000
Expand Down

0 comments on commit ef07fed

Please sign in to comment.