2021-12-28 04:23:33 +00:00
|
|
|
FROM golang:latest as builder
|
|
|
|
WORKDIR /build
|
|
|
|
COPY . .
|
|
|
|
RUN go get -u
|
2022-08-23 01:20:01 +00:00
|
|
|
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o probehost2
|
2021-12-28 03:29:37 +00:00
|
|
|
|
2021-12-28 04:23:33 +00:00
|
|
|
FROM alpine:latest
|
2021-12-28 03:29:37 +00:00
|
|
|
RUN apk update
|
2022-08-23 01:20:01 +00:00
|
|
|
RUN apk add mtr iputils nmap-nping traceroute
|
|
|
|
RUN adduser -D probehost2
|
2021-12-28 04:23:33 +00:00
|
|
|
COPY --from=builder /build/probehost2 /
|
|
|
|
RUN touch /probehost2.log
|
2022-08-23 01:20:01 +00:00
|
|
|
RUN chown probehost2:users /probehost2.log
|
|
|
|
USER probehost2
|
2021-12-28 04:23:33 +00:00
|
|
|
CMD ["/probehost2"]
|