docker_bind/run_bind_container.sh

23 lines
728 B
Bash
Raw Normal View History

2023-02-24 14:12:21 +00:00
#! /bin/bash
2023-02-25 20:27:49 +00:00
#BASE_CONF_DIR=/etc/bind
BASE_CONF_DIR=/home/davidb/src/docker_bind
2023-02-26 00:30:43 +00:00
: "${DNS_PORT:=55}" # non-production default
: "${RNDC_PORT:=955}" # non-produciton default
2023-02-25 20:27:49 +00:00
CMD="/etc/bind/run.sh"
2023-02-25 19:51:25 +00:00
[ "$1" = "interactive" ] && ARGS="-ti --entrypoint=/bin/bash" && CMD=""
2023-02-24 14:12:21 +00:00
# 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 \
2023-02-25 19:51:25 +00:00
docker.io/internetsystemsconsortium/bind9:9.18 $CMD