-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathDockerfile
37 lines (28 loc) · 1006 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
# syntax = docker/dockerfile:1.2
FROM golang:1.16 as builder
# specify the probe to build
ARG PROBER
# specify the apps under probe to build, all if not specified
ARG APPS
ENV PROBER=${PROBER}
ENV APPS=${APPS}
ENV GOPROXY=https://goproxy.cn,direct
COPY . /go/src/github.com/erda-project/kubeprober
WORKDIR /go/src/github.com/erda-project/kubeprober
RUN go mod tidy
# Build
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
cd probers && \
echo "workdir: $(pwd)" && \
echo "content: $(ls -lh)" && \
./build.sh --prober=${PROBER} --apps=${APPS}
# no bash in image alpine, please use sh
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM kubeprober/probe-base:v0.1.6
COPY --from=builder /checkers checkers
COPY probers/run.sh /checkers/run.sh
WORKDIR /checkers
RUN chmod +x /checkers/run.sh
CMD [ "sh", "-c", "/checkers/run.sh"]