bind start script
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2025-10-27 13:27:01 +01:00
parent 74cbdb9fae
commit e957cb51c0
2 changed files with 18 additions and 20 deletions

View File

@@ -3,10 +3,14 @@ FROM alpine:3.22.2
LABEL Maintainer="Wolfgang Hottgenroth <woho@hottis.de>"
LABEL ImageName="bind-hidden-primary"
RUN apk add --no-cache bind bind-tools bash git openssh-client-default
RUN mkdir -p /etc/named-dist
RUN \
apk add --no-cache bind bind-tools bash git openssh-client-default && \
mkdir -p /etc/named && \
mkdir -p /etc/named/keys && \
mkdir -p /etc/named/zones && \
mkdir -p /etc/named-dist
COPY named.conf /etc/named-dist/
COPY named.conf /etc/named/
COPY whiskeylimahotel.de.zone /etc/named-dist/
COPY zones.conf /etc/named-dist/
COPY transfer-key.conf /etc/named-dist/

View File

@@ -3,24 +3,18 @@ set -ex
echo "Starting BIND initialization..."
mkdir -p /etc/named
INITIALLY_INSTALLED_FLAG="/etc/named/zones/initialized"
# Copy template files to working directories if they don't exist
if [ ! -f /etc/knot/knot.conf ]; then
echo "Copying knot.conf from template..."
cp /etc/knot-dist/knot.conf /etc/knot/
echo "Copying zone file from template..."
cp /var/lib/knot-dist/my-dnssec-test-domain.de.zone /var/lib/knot/
if [ ! -f $INITIALLY_INSTALLED_FLAG ]; then
echo "Initialized ..."
touch $INITIALLY_INSTALLED_FLAG
cp /etc/named-dist/transfer-key.conf /etc/named/keys/transfer-key.conf
cp /etc/named-dist/zones.conf /etc/named/zones/zones.conf
cp /etc/named-dist/whiskeylimahotel.de.zone /etc/named/zones/whiskeylimahotel.de.zone
else
echo "Already initialized, skipping initial setup."
fi
# Ensure proper ownership
echo "Setting file ownership..."
chown -R knot:knot /etc/knot /var/lib/knot
# Check configuration
echo "Validating configuration..."
/usr/sbin/knotc conf-check
echo "Starting Knot DNS server..."
exec /usr/sbin/knotd
echo "Starting BIND server..."
exec /usr/sbin/named -f