2023-02-24 14:12:21 +00:00
|
|
|
#! /bin/bash
|
2024-09-18 02:22:27 +00:00
|
|
|
|
|
|
|
# This is not normally how this container is launched. Instead, see
|
|
|
|
# named.container, which allows podman-systemd to construct a systemd
|
|
|
|
# unit files and run using podman.
|
|
|
|
#
|
|
|
|
# Instead, this script can be used to launch the container "by hand".
|
|
|
|
|
2023-02-26 00:41:29 +00:00
|
|
|
BASE_CONF_DIR=/etc/bind
|
2024-09-18 02:22:27 +00:00
|
|
|
CMD="-f -c /etc/bind/named.conf"
|
|
|
|
[ "$1" = "interactive" ] && ARGS="-ti --entrypoint=/bin/sh" && CMD=""
|
2023-02-26 19:44:24 +00:00
|
|
|
|
2024-09-18 02:22:27 +00:00
|
|
|
[ -x /usr/bin/docker ] && DOCKER=/usr/bin/docker
|
|
|
|
[ -x /usr/bin/podman ] && DOCKER=/usr/bin/podman
|
|
|
|
|
|
|
|
# Note that as of 2024-09-01, this image is based on Alpine linux and its entrypoint is:
|
|
|
|
# '/usr/sbin/named -u bind'
|
|
|
|
# and the default command is:
|
|
|
|
# '-f -c /etc/bind/named.conf -L /var/log/bind/default.log'
|
2023-02-24 14:12:21 +00:00
|
|
|
|
|
|
|
# shellcheck disable=SC2086
|
2024-09-18 02:22:27 +00:00
|
|
|
$DOCKER run $ARGS \
|
2023-02-24 14:12:21 +00:00
|
|
|
--rm \
|
|
|
|
--name=bind9 \
|
2023-02-26 19:44:24 +00:00
|
|
|
--network=host \
|
2023-02-24 14:12:21 +00:00
|
|
|
-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 \
|
2024-09-18 02:22:27 +00:00
|
|
|
docker.io/internetsystemsconsortium/bind9:9.18 "$CMD"
|