2024-09-06 20:19:32 +01:00
|
|
|
FROM golang:1.22-alpine3.20 AS builder
|
2024-09-06 04:04:11 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2024-09-06 15:03:37 +01:00
|
|
|
RUN apk --no-cache update && apk --no-cache upgrade && apk --no-cache add curl
|
2024-09-06 04:04:11 +01:00
|
|
|
|
|
|
|
COPY --from=builder /app/build/goscan /goscan
|
2024-09-06 15:03:37 +01:00
|
|
|
COPY ./entrypoint.sh /entrypoint.sh
|
2024-09-06 04:04:11 +01:00
|
|
|
|
2024-09-06 15:03:37 +01:00
|
|
|
RUN chmod +x /goscan && chmod +x /entrypoint.sh
|
2024-09-06 04:04:11 +01:00
|
|
|
|
2024-09-06 15:03:37 +01:00
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|