1
0
woodpecker-sonatype-nexus/Dockerfile

39 lines
580 B
Docker
Raw Permalink Normal View History

2024-07-26 01:35:58 +03:00
ARG GO_IMAGE=docker.io/library/golang:1.22.5-bookworm
2024-05-28 14:41:14 +03:00
ARG BASE_IMAGE=gcr.io/distroless/static-debian12:debug-nonroot
## ---
FROM ${GO_IMAGE} as build
SHELL [ "/bin/sh", "-ec" ]
ARG GOPROXY
ARG GOSUMDB
ARG GOPRIVATE
ARG RELMODE
WORKDIR /go/src
COPY . .
2024-07-26 01:35:58 +03:00
ENV GOMAXPROCS=2 \
2024-05-28 14:41:14 +03:00
MALLOC_ARENA_MAX=4
RUN go env | grep -F -e GOPROXY -e GOSUMDB ; \
make OUTDIR=/go/bin ; \
make ci-clean
## ---
FROM ${BASE_IMAGE}
COPY --from=build /go/bin/publish-nexus /bin/
ENV GOMAXPROCS=4 \
MALLOC_ARENA_MAX=4
ENTRYPOINT [ ]
CMD [ "/bin/publish-nexus" ]
USER nonroot:nonroot