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
12 changes: 5 additions & 7 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,11 @@ jobs:
with:
submodules: recursive

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Build binary
run: |
CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath -o prom2parquet ./cmd/.
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Container Registry
if: github.event_name != 'pull_request'
Expand Down Expand Up @@ -63,6 +60,7 @@ jobs:
with:
context: .
file: ./images/Dockerfile.prom2parquet
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
22 changes: 17 additions & 5 deletions images/Dockerfile.prom2parquet
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
FROM golang:1.24-alpine
FROM golang:1.24-alpine AS builder

RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64
RUN chmod +x /usr/local/bin/dumb-init
WORKDIR /build
COPY . .
RUN CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath -o prom2parquet ./cmd/.

RUN go install github.com/go-delve/delve/cmd/dlv@latest
FROM alpine:latest

COPY prom2parquet /prom2parquet
ARG TARGETARCH
RUN apk add --no-cache wget && \
case ${TARGETARCH} in \
"amd64") DUMB_INIT_ARCH=x86_64 ;; \
"arm64") DUMB_INIT_ARCH=aarch64 ;; \
*) echo "Unsupported architecture: ${TARGETARCH}" && exit 1 ;; \
esac && \
wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_${DUMB_INIT_ARCH} && \
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

This RUN step downloads a precompiled dumb-init binary over HTTPS and executes it as PID 1 without any integrity verification (no checksum or signature check), creating a supply-chain risk if the GitHub release or delivery path is ever compromised. An attacker who can influence the downloaded binary could gain code execution inside every built container that uses this image. To mitigate this, pin the binary with a strong checksum or signature (or install via a trusted package source or vendored artifact) and verify it before making it executable.

Copilot uses AI. Check for mistakes.
chmod +x /usr/local/bin/dumb-init && \
apk del wget

COPY --from=builder /build/prom2parquet /prom2parquet

ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]
Loading