optimze the docker build
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Simon Vieille 2023-06-09 11:31:49 +02:00
parent 528b3c1da8
commit cf97958081
Signed by: deblan
GPG key ID: 579388D585F70417

View file

@ -1,12 +1,15 @@
FROM golang:1.19 as builder
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build
RUN CGO_ENABLED=0 GOOS=linux go build -o /app/capture
FROM debian:stable-slim
RUN apt-get update && apt-get install ca-certificates -y
COPY --from=builder /src/capture /usr/bin/capture
RUN apt-get update && apt-get install -y ca-certificates
COPY --from=builder /app/capture /usr/bin/capture
ENTRYPOINT ["/usr/bin/capture"]