forked from boring-registry/boring-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (18 loc) · 715 Bytes
/
Dockerfile
File metadata and controls
25 lines (18 loc) · 715 Bytes
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
# ARG before first stage to share the value across multiple stages
ARG BASEDIR=/go/src/github.com/boring-registry/boring-registry
FROM golang:1.25.5 AS build
ARG VERSION
ARG GIT_COMMIT
ARG BUILD_TIMESTAMP
ARG BASEDIR # use the default value
WORKDIR ${BASEDIR}
COPY . ${BASEDIR}
RUN CGO_ENABLED=0 go build -ldflags "-s -w \
-X github.com/boring-registry/boring-registry/version.Version=${VERSION} \
-X github.com/boring-registry/boring-registry/version.Commit=${GIT_COMMIT} \
-X github.com/boring-registry/boring-registry/version.Date=${BUILD_TIMESTAMP}"
FROM gcr.io/distroless/base:nonroot
ARG BASEDIR
COPY --from=build ${BASEDIR}/boring-registry /
ENTRYPOINT ["/boring-registry"]
CMD ["server"]