goscan/docker/Action.Dockerfile

25 lines
815 B
Docker
Raw Permalink 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
2024-09-13 21:56:18 +01:00
LABEL maintainer="shane@scaffoe.com" \
org.opencontainers.image.authors="Shane C." \
org.opencontainers.image.source="https://git.shadowhosting.xyz/shanec/goscan" \
org.opencontainers.image.licenses="Unlicense" \
org.opencontainers.image.title="GoScan (GoSec Scanner for Forgejo)"
2024-09-12 01:11:35 +01:00
RUN apk --no-cache update && apk --no-cache upgrade && apk add curl
2024-09-12 01:02:44 +01:00
COPY --from=builder /usr/local/go /usr/local/go
COPY --from=builder /app/build/goscan /goscan
2024-09-13 21:56:18 +01:00
COPY ./docker/action_entrypoint.sh /entrypoint.sh
2024-09-06 15:03:37 +01:00
RUN chmod +x /goscan && chmod +x /entrypoint.sh
2024-09-08 19:57:55 +01:00
ENV PATH="/usr/local/go/bin:${PATH}"
2024-09-06 15:03:37 +01:00
ENTRYPOINT ["/entrypoint.sh"]