Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker: run adguardhome as adguardhome user #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions scripts/make/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ LABEL\
org.opencontainers.image.version=$VERSION

# Update certificates.
RUN apk --no-cache add ca-certificates libcap tzdata && \
RUN apk --no-cache add ca-certificates libcap tzdata shadow && \
mkdir -p /opt/adguardhome/conf /opt/adguardhome/work && \
chown -R nobody: /opt/adguardhome

Expand Down Expand Up @@ -54,7 +54,14 @@ EXPOSE 53/tcp 53/udp 67/udp 68/udp 80/tcp 443/tcp 443/udp 784/udp\

WORKDIR /opt/adguardhome/work

ENTRYPOINT ["/opt/adguardhome/AdGuardHome"]
COPY --chown=nobody:nogroup\
./${DIST_DIR}/docker/entrypoint.sh\
/opt/adguardhome/entrypoint.sh

RUN addgroup -S adguardhome
RUN adduser -s /sbin/nologin -S -D -H -G adguardhome adguardhome

ENTRYPOINT ["/opt/adguardhome/entrypoint.sh"]

CMD [ \
"--no-check-update", \
Expand Down
4 changes: 4 additions & 0 deletions scripts/make/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
usermod -ou ${PUID:-0} adguardhome
su -s /bin/sh adguardhome -c "/opt/adguardhome/AdGuardHome $*"