25 lines
No EOL
815 B
Docker
25 lines
No EOL
815 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
|
|
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)"
|
|
|
|
RUN apk --no-cache update && apk --no-cache upgrade && apk add curl
|
|
|
|
COPY --from=builder /usr/local/go /usr/local/go
|
|
COPY --from=builder /app/build/goscan /goscan
|
|
COPY ./docker/action_entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /goscan && chmod +x /entrypoint.sh
|
|
|
|
ENV PATH="/usr/local/go/bin:${PATH}"
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"] |