Skip to content

Commit

Permalink
Reduce Docker image size (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
levaitamas authored Sep 18, 2024
1 parent 645f6fd commit 2f1fa7c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.5-bullseye AS builder
FROM golang:1.22-alpine AS builder

WORKDIR /app

Expand All @@ -8,17 +8,13 @@ RUN go mod download

COPY . .

RUN go build -o /iceperf-agent cmd/iceperf/main.go
RUN CGO_ENABLED=0 ldflags="-s -w" go build -o /iceperf-agent cmd/iceperf/main.go

FROM debian:bullseye-slim
FROM gcr.io/distroless/static

WORKDIR /

RUN apt-get update && apt-get install -y ca-certificates

COPY --from=builder /iceperf-agent .

RUN ls -lsa /

ENTRYPOINT ["./iceperf-agent"]
CMD ["-h"]

0 comments on commit 2f1fa7c

Please sign in to comment.