这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM golang:1.22-bookworm as build
ARG GOLANG_VERSION=1.22.7
FROM golang:${GOLANG_VERSION} AS build
LABEL maintainer="githubexporter"

ENV GO111MODULE=on
Expand All @@ -10,13 +11,9 @@ RUN go mod download \
&& go test ./... \
&& CGO_ENABLED=0 GOOS=linux go build -o /bin/main

FROM alpine:3
FROM gcr.io/distroless/static AS runtime

RUN apk --no-cache add ca-certificates \
&& addgroup exporter \
&& adduser -S -G exporter exporter
ADD VERSION .
USER exporter
COPY --from=build /bin/main /bin/main
ENV LISTEN_PORT=9171
EXPOSE 9171
Expand Down