diff --git a/Dockerfile b/Dockerfile index fab5aab..0740b7d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,28 +1,21 @@ -FROM ubuntu:focal-20200423 AS add-apt-repositories +FROM debian:bookworm AS add-apt-repositories RUN apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg \ - && apt-key adv --fetch-keys http://www.webmin.com/jcameron-key.asc \ - && echo "deb http://download.webmin.com/download/repository sarge contrib" >> /etc/apt/sources.list - -FROM ubuntu:focal-20200423 + && DEBIAN_FRONTEND=noninteractive apt-get install -y systemctl curl gnupg ntp apt-utils \ + && apt-get update \ + && curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh \ + && sh setup-repos.sh --force \ + && apt-get update LABEL maintainer="sameer@damagehead.com" ENV BIND_USER=bind \ - BIND_VERSION=9.16.1 \ - WEBMIN_VERSION=1.941 \ DATA_DIR=/data -COPY --from=add-apt-repositories /etc/apt/trusted.gpg /etc/apt/trusted.gpg - -COPY --from=add-apt-repositories /etc/apt/sources.list /etc/apt/sources.list - RUN rm -rf /etc/apt/apt.conf.d/docker-gzip-indexes \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - bind9=1:${BIND_VERSION}* bind9-host=1:${BIND_VERSION}* dnsutils \ - webmin=${WEBMIN_VERSION}* \ + bind9 bind9-host dnsutils webmin \ && rm -rf /var/lib/apt/lists/* COPY entrypoint.sh /sbin/entrypoint.sh diff --git a/Makefile b/Makefile index 77afd08..5af55bb 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ all: build build: - @docker build --tag=sameersbn/bind . + @docker build --tag=crispychrispe/bind9-webmin2 . diff --git a/docker-compose.yml b/docker-compose.yml index c44872e..66f8e44 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: '2' services: bind: restart: always - image: sameersbn/bind:9.16.1-20200524 + image: crispychrispe/bind9-webmin2:latest ports: - "53:53/udp" - "53:53/tcp" diff --git a/entrypoint.sh b/entrypoint.sh index 3381555..48e85c4 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -95,6 +95,10 @@ create_bind_cache_dir() { chown root:${BIND_USER} /var/cache/bind } +fix_bind_servicename() { + sed -i 's/bind9.service/named.service/g' /etc/webmin/bind8/config +} + first_init() { if [ ! -f /data/.initialized ]; then set_webmin_redirect_port @@ -127,8 +131,9 @@ if [[ -z ${1} ]]; then create_webmin_data_dir first_init set_root_passwd + fix_bind_servicename echo "Starting webmin..." - /etc/init.d/webmin start + systemctl start webmin fi echo "Starting named..."