-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile-nodemgr
24 lines (18 loc) · 726 Bytes
/
Dockerfile-nodemgr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM golang:1.23-alpine as builder
ARG REL_VER
# Install git and certificates
RUN apk --no-cache add tzdata zip ca-certificates git
# Make repository path
RUN mkdir -p /go/src/app
WORKDIR /go/src/app
# just fetch the dependencies in a cachable layer
COPY nodemgr/go.* ./nodemgr/
RUN cd nodemgr && go mod download && cd ..
# Copy all project files (.env's are skipped due to .dockerignore)
COPY . ./
RUN --mount=type=cache,target=/root/.cache/go-build env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -C nodemgr -v -ldflags "-X main.Version=${REL_VER}" -o /out/ .
FROM scratch
WORKDIR /app
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /out/* /app/
ENTRYPOINT ["/app/reti"]