Skip to content

Commit c505332

Browse files
authored
Merge pull request #274 from TheQue42/master
Update Dockerfile to enable non-root user with cap_add
2 parents f4e2141 + b710f2b commit c505332

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docker/heplify/Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ COPY . /heplify
66
WORKDIR /heplify
77
RUN CGO_ENABLED=1 GOOS=linux go build -a --ldflags '-linkmode external -extldflags "-static -s -w"' -o heplify .
88

9-
FROM scratch
9+
FROM alpine
10+
RUN apk --no-cache add ca-certificates tzdata libcap
1011
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
1112
COPY --from=builder /heplify/heplify .
12-
CMD ["./heplify", "-h"]
13+
RUN /usr/sbin/setcap cap_net_raw,cap_net_admin=eip heplify
14+
CMD ["./heplify", "-h"]

0 commit comments

Comments
 (0)