-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (25 loc) · 728 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
ARG GOLANG_VERSION="1.21.0"
ARG PROJECT="gcp-oidc-token-proxy"
ARG COMMIT
ARG VERSION
FROM docker.io/golang:${GOLANG_VERSION} as build
ARG PROJECT
ARG COMMIT
ARG VERSION
WORKDIR /${PROJECT}
COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download
COPY cmd/proxy cmd/proxy
RUN BUILD_TIME=$(date +%s) && \
CGO_ENABLED=0 GOOS=linux go build \
-a \
-installsuffix cgo \
-ldflags "-X 'main.BuildTime=${BUILD_TIME}' -X 'main.GitCommit=${COMMIT}' -X 'main.OSVersion=${VERSION}'" \
-o /bin/proxy \
./cmd/proxy
FROM gcr.io/distroless/cc
LABEL org.opencontainers.image.source https://github.com/DazWilkin/gcp-oidc-token-proxy
COPY --from=build /bin/proxy /
ENTRYPOINT ["/proxy"]
CMD ["--port=7777"]