-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (24 loc) · 860 Bytes
/
Dockerfile
File metadata and controls
33 lines (24 loc) · 860 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
26
27
28
29
30
31
32
33
FROM golang:1.20 as builder
ARG VERSION
# Copy sources into correct working directory.
WORKDIR /go/src/github.com/m-lab/etl-gardener
COPY . .
# Build fully static binary.
ENV CGO_ENABLED 0
# Get the requirements and put the produced binaries in /go/bin
RUN go get -v ./...
WORKDIR /go/src/github.com/m-lab/etl-gardener
# NOTE: the version is either a branch, a specific tag, or a short git commit.
RUN go install -v \
-ldflags "-X github.com/m-lab/go/prometheusx.GitShortCommit=$(git log -1 --format=%h) \
-X main.Version=$VERSION \
-X main.GitCommit=$(git log -1 --format=%H)" \
./cmd/gardener
FROM alpine:3.18
RUN apk update && \
apk add ca-certificates && \
rm -rf /var/cache/apk/*
COPY --from=builder /go/bin/gardener /bin/gardener
EXPOSE 9090 8080 8081
WORKDIR /
ENTRYPOINT [ "/bin/gardener" ]