Skip to content

Commit

Permalink
Use non-root user in docker container (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xERR0R committed Dec 23, 2021
1 parent d7bf373 commit 1fd7ddd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@ LABEL org.opencontainers.image.source="https://github.com/0xERR0R/blocky" \
org.opencontainers.image.url="https://github.com/0xERR0R/blocky" \
org.opencontainers.image.title="DNS proxy as ad-blocker for local network"

RUN apk add --no-cache ca-certificates bind-tools tini tzdata
COPY --from=build-env /src/bin/blocky /app/blocky
RUN apk add --no-cache ca-certificates bind-tools tini tzdata libcap && \
adduser -S -D -H -h /app -s /sbin/nologin blocky && \
setcap 'cap_net_bind_service=+ep' /app/blocky

HEALTHCHECK --interval=1m --timeout=3s CMD dig @127.0.0.1 -p 53 healthcheck.blocky +tcp +short || exit 1

USER blocky
WORKDIR /app

ENTRYPOINT ["/sbin/tini", "--"]
Expand Down

0 comments on commit 1fd7ddd

Please sign in to comment.