-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile.tools
29 lines (27 loc) · 1008 Bytes
/
Dockerfile.tools
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
FROM golang:1.20 AS builder
WORKDIR /src/aerospike-operator/
COPY go.mod go.sum ./
RUN go mod download
COPY hack/tools/go.mod hack/tools/go.sum ./hack/tools/
RUN cd ./hack/tools/ && go mod download
COPY . .
RUN make build BIN=backup OUT=/backup
RUN make build BIN=asinit OUT=/asinit
WORKDIR $GOPATH/src/github.com/alicebob/asprom
RUN git clone https://github.com/alicebob/asprom .
RUN CGO_ENABLED=0 go build \
-a \
-v \
-ldflags="-d -s -w" \
-tags=netgo \
-installsuffix=netgo \
-o=/asprom *.go
FROM aerospike/aerospike-tools:8.1.0 AS astools
FROM gcr.io/distroless/cc
USER 65532:65532
COPY --from=builder /asinit /usr/local/bin/asinit
COPY --from=builder /asprom /usr/local/bin/asprom
COPY --from=builder /backup /usr/local/bin/backup
COPY --from=astools --chown=0:0 /lib/x86_64-linux-gnu/libz.so.1 /lib/x86_64-linux-gnu/libz.so.1
COPY --from=astools --chown=0:0 /usr/bin/asbackup /usr/local/bin/asbackup
COPY --from=astools --chown=0:0 /usr/bin/asrestore /usr/local/bin/asrestore