goscan/Dockerfile

17 lines
333 B
Docker
Raw Normal View History

FROM golang:1.22-alpine3.20 as builder
WORKDIR /app
COPY . .
RUN go mod download && go mod verify
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -trimpath -o build/goscan
FROM alpine:3.20
RUN apk --no-cache update && apk --no-cache upgrade
COPY --from=builder /app/build/goscan /goscan
RUN chmod +x /goscan
ENTRYPOINT ["/goscan"]