docker_bind/run_bind.sh

22 lines
646 B
Bash
Raw Normal View History

2023-02-24 14:12:21 +00:00
#! /bin/bash
BASE_CONF_DIR=/etc/bind
: "${DNS_PORT:=53}"
: "${RNDC_PORT:=953}"
[ "$1" = "interactive" ] && ARGS="-ti --entrypoint=/bin/bash"
# shellcheck disable=SC2086
docker run $ARGS \
--rm \
--name=bind9 \
2023-02-25 19:48:21 +00:00
--add-host=host.docker.internal:host-gateway \
2023-02-24 14:12:21 +00:00
--publish "$RNDC_PORT:953/tcp" \
--publish "$DNS_PORT:53/udp" \
--publish "$DNS_PORT:53/tcp" \
-v $BASE_CONF_DIR/cfg:/etc/bind \
-v $BASE_CONF_DIR/cache:/var/cache/bind \
-v $BASE_CONF_DIR/zones:/var/lib/bind \
-v $BASE_CONF_DIR/log:/var/log \
docker.io/internetsystemsconsortium/bind9:9.18 \
/usr/sbin/named -c /etc/bind/named.conf -4 -f