Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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="[email protected]"

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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
all: build

build:
@docker build --tag=sameersbn/bind .
@docker build --tag=crispychrispe/bind9-webmin2 .
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 6 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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..."
Expand Down