generated from telekom/reuse-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (27 loc) · 873 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
# Copyright 2024 Deutsche Telekom IT GmbH
#
# SPDX-License-Identifier: Apache-2.0
FROM golang:1.22-alpine AS build
ARG HTTP_PROXY
ARG HTTPS_PROXY
ENV HTTP_PROXY=$HTTP_PROXY
ENV HTTPS_PROXY=$HTTPS_PROXY
WORKDIR /build
COPY . .
RUN apk add --no-cache build-base
RUN apk add --no-cache --update ca-certificates
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s -extldflags=-static" -o ./out/probe
FROM scratch
ENV PROBE_ARG_MESSAGE_COUNT=3
ENV PROBE_ARG_TIMEOUT=30s
ENV PROBE_ARG_MAX_LATENCY=5s
ENV PROBE_ARG_TEMPLATE=template.json
COPY --from=build /build/out/probe .
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
ENTRYPOINT ["./probe"]
CMD ["start",\
"--message-count=$PROBE_ARG_MESSAGE_COUNT",\
"--timeout=$PROBE_ARG_TIMEOUT",\
"--max-latency=$PROBE_ARG_MAX_LATENCY",\
"--template=$PROBE_ARG_TEMPLATE"\
]