mirror of
https://github.com/byReqz/probehost2.git
synced 2024-11-21 14:23:15 +00:00
docker: trim binary, add standalone traceroute, run as own user
This commit is contained in:
parent
2866c9915d
commit
deab05167d
@ -2,11 +2,14 @@ FROM golang:latest as builder
|
|||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN go get -u
|
RUN go get -u
|
||||||
RUN CGO_ENABLED=0 go build -o probehost2
|
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o probehost2
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
RUN apk update
|
RUN apk update
|
||||||
RUN apk add mtr iputils nmap-nping
|
RUN apk add mtr iputils nmap-nping traceroute
|
||||||
|
RUN adduser -D probehost2
|
||||||
COPY --from=builder /build/probehost2 /
|
COPY --from=builder /build/probehost2 /
|
||||||
RUN touch /probehost2.log
|
RUN touch /probehost2.log
|
||||||
|
RUN chown probehost2:users /probehost2.log
|
||||||
|
USER probehost2
|
||||||
CMD ["/probehost2"]
|
CMD ["/probehost2"]
|
||||||
|
Loading…
Reference in New Issue
Block a user