AdGuardHome/docker/Dockerfile
Dimitry Kolyshev e54fc9b1e9 Pull request: web-addr-cmdline
Merge in DNS/adguard-home from web-addr-cmdline to master

Squashed commit of the following:

commit 27652dbfae227f9a9f4d921f14af1e5897d7830d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Thu Jun 22 17:51:43 2023 +0400

    home: web-addr opt

commit b234d108e70fed3ff11eeb4986946f8a50dda515
Merge: eef1b5cbb 66345e855
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Thu Jun 22 17:10:57 2023 +0400

    Merge remote-tracking branch 'origin/master' into web-addr-cmdline

    # Conflicts:
    #	CHANGELOG.md

commit eef1b5cbb9f7dd9819c8038800a4bbcf3ff575aa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Thu Jun 22 17:04:12 2023 +0400

    all: docs

    Updates #4231.

commit b4adb0bae82e44101f7b6685a29926c3d02e95af
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Thu Jun 22 16:58:12 2023 +0400

    all: docker

    Updates #4231.

commit a4012fddc50a3f5143136df8f3b865d7e1b9087c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Thu Jun 22 11:24:02 2023 +0400

    all: docker

commit bd5cc3308298b1022dea501c2fe79d96df24ce2a
Merge: 36841dd85 123ca8738
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Thu Jun 22 11:22:51 2023 +0400

    Merge remote-tracking branch 'origin/master' into web-addr-cmdline

commit 36841dd85fe1d006e6ec518329cb8ceea0915599
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Wed Jun 21 11:53:40 2023 +0400

    all: docker

commit 5c4756a56d251f1486b92f333f11485b5f4807f4
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Wed Jun 21 11:50:41 2023 +0400

    all: imp docs

commit 7b6fba81f2d5a354bdf259d812d04f3bd64de0c6
Merge: 54c119024 ca313521d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Wed Jun 21 11:47:36 2023 +0400

    Merge remote-tracking branch 'origin/master' into web-addr-cmdline

commit 54c119024f3999d5c4dec06b21e3bb78803bf388
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Tue Jun 20 15:57:54 2023 +0400

    home: imp code

commit c87e0a690376aa6a28a018c3cbbb5de0ad16333d
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Tue Jun 20 15:56:45 2023 +0400

    all: imp docs

commit de240d00e334f7fd3dbf39ac08472183deeb32db
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Tue Jun 20 15:54:27 2023 +0400

    all: docker

commit 568d5371e73fb6c5ba19a036e7a5135764f6538b
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Tue Jun 20 13:38:53 2023 +0400

    all: docs

commit 407e230c8e3bc293e8d533ca5db1f28fec4b3c54
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Tue Jun 20 13:24:23 2023 +0400

    home: deprecate opts

commit 6e628fad6f4ee9f23213eeb55bec500db4435175
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Tue Jun 20 13:18:10 2023 +0400

    home: web-addr opt
2023-06-23 10:03:01 +03:00

86 lines
2.9 KiB
Docker

# A docker file for scripts/make/build-docker.sh.
FROM alpine:3.17
ARG BUILD_DATE
ARG VERSION
ARG VCS_REF
LABEL\
maintainer="AdGuard Team <devteam@adguard.com>" \
org.opencontainers.image.authors="AdGuard Team <devteam@adguard.com>" \
org.opencontainers.image.created=$BUILD_DATE \
org.opencontainers.image.description="Network-wide ads & trackers blocking DNS server" \
org.opencontainers.image.documentation="https://github.com/AdguardTeam/AdGuardHome/wiki/" \
org.opencontainers.image.licenses="GPL-3.0" \
org.opencontainers.image.revision=$VCS_REF \
org.opencontainers.image.source="https://github.com/AdguardTeam/AdGuardHome" \
org.opencontainers.image.title="AdGuard Home" \
org.opencontainers.image.url="https://adguard.com/en/adguard-home/overview.html" \
org.opencontainers.image.vendor="AdGuard" \
org.opencontainers.image.version=$VERSION
# Update certificates.
RUN apk --no-cache add ca-certificates libcap tzdata && \
mkdir -p /opt/adguardhome/conf /opt/adguardhome/work && \
chown -R nobody: /opt/adguardhome
RUN apk --no-cache add tini
ARG DIST_DIR
ARG TARGETARCH
ARG TARGETOS
ARG TARGETVARIANT
COPY --chown=nobody:nogroup\
./${DIST_DIR}/docker/AdGuardHome_${TARGETOS}_${TARGETARCH}_${TARGETVARIANT}\
/opt/adguardhome/AdGuardHome
RUN setcap 'cap_net_bind_service=+eip' /opt/adguardhome/AdGuardHome
# 53 : TCP, UDP : DNS
# 67 : UDP : DHCP (server)
# 68 : UDP : DHCP (client)
# 80 : TCP : HTTP (main)
# 443 : TCP, UDP : HTTPS, DNS-over-HTTPS (incl. HTTP/3), DNSCrypt (main)
# 784 : UDP : DNS-over-QUIC (experimental)
# 853 : TCP, UDP : DNS-over-TLS, DNS-over-QUIC
# 3000 : TCP, UDP : HTTP(S) (alt, incl. HTTP/3)
# 3001 : TCP, UDP : HTTP(S) (beta, incl. HTTP/3)
# 5443 : TCP, UDP : DNSCrypt (alt)
# 6060 : TCP : HTTP (pprof)
# 8853 : UDP : DNS-over-QUIC (experimental)
#
# TODO(a.garipov): Remove the old, non-standard 784 and 8853 ports for
# DNS-over-QUIC in a future release.
EXPOSE 53/tcp 53/udp 67/udp 68/udp 80/tcp 443/tcp 443/udp 784/udp\
853/tcp 853/udp 3000/tcp 3000/udp 5443/tcp\
5443/udp 6060/tcp 8853/udp
WORKDIR /opt/adguardhome/work
# Install helpers for healthcheck.
COPY --chown=nobody:nogroup\
./${DIST_DIR}/docker/scripts\
/opt/adguardhome/scripts
HEALTHCHECK \
--interval=30s \
--timeout=10s \
--retries=3 \
CMD [ "/opt/adguardhome/scripts/healthcheck.sh" ]
# It seems that the healthckech script sometimes spawns zombie processes, so we
# need a way to handle them, since AdGuard Home doesn't know how to keep track
# of the processes delegated to it by the OS. Use tini as entry point because
# it needs the PID=1 to be the default parent for orphaned processes.
#
# See https://github.com/adguardTeam/adGuardHome/issues/3290.
ENTRYPOINT [ "/sbin/tini", "--" ]
CMD [ \
"/opt/adguardhome/AdGuardHome", \
"--no-check-update", \
"-c", "/opt/adguardhome/conf/AdGuardHome.yaml", \
"-w", "/opt/adguardhome/work" \
]