goscan/Dockerfile
Shane C e01a930f46
Some checks failed
Gosec Check / Gosec Check (push) Failing after 1m4s
download golang
2024-09-08 14:18:09 -04:00

20 lines
No EOL
597 B
Docker

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 && apk add wget curl
RUN wget https://go.dev/dl/go1.23.1.linux-amd64.tar.gz && tar -xf go1.23.1.linux-amd64.tar.gz -C /usr/local && rm -rf go1.23.1.linux-amd64.tar.gz
COPY --from=builder /app/build/goscan /goscan
COPY ./entrypoint.sh /entrypoint.sh
COPY --from=builder /app .
RUN chmod +x /goscan && chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]