From b3cf0bafecfadd5ef041da73d873e3840df8ede8 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Sun, 26 Oct 2025 21:52:06 +0100 Subject: [PATCH] changes --- .woodpecker.yml | 29 +++++++++++++++++++++++++++++ Dockerfile | 26 ++++++++++++++++++++++++++ start.sh | 26 ++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 .woodpecker.yml create mode 100644 Dockerfile create mode 100755 start.sh diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..246e005 --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,29 @@ +steps: + build: + image: plugins/kaniko + settings: + repo: ${FORGE_NAME}/${CI_REPO} + registry: + from_secret: container_registry + tags: latest,${CI_COMMIT_SHA} + username: + from_secret: container_registry_username + password: + from_secret: container_registry_password + + dockerfile: Dockerfile + when: + - event: [tag,push] + + deploy: + image: portainer/kubectl-shell:latest + environment: + KUBE_CONFIG_CONTENT: + from_secret: kube_config + commands: + - export IMAGE_TAG=$CI_COMMIT_SHA + - printf "$KUBE_CONFIG_CONTENT" > /tmp/kubeconfig + - export KUBECONFIG=/tmp/kubeconfig + - ./deployment/deploy.sh + when: + - event: [tag,push] diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f741f15 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM alpine:3.22.2 + +LABEL Maintainer="Wolfgang Hottgenroth " +LABEL ImageName="bind-hidden-primary" + +RUN apk add --no-cache bind bind-tools bash git openssh-client-default +RUN mkdir -p /etc/named-dist + +COPY named.conf /etc/named-dist/ +COPY whiskeylimahotel.de.zone /etc/named-dist/ +COPY zones.conf /etc/named-dist/ +COPY transfer-key.conf /etc/named-dist/ +COPY start.sh /usr/local/bin/start.sh + +RUN chmod +x /usr/local/bin/start.sh + +WORKDIR /etc/named +VOLUME /etc/named/zones +VOLUME /etc/named/keys + +EXPOSE 8053/udp +EXPOSE 8053/tcp + +CMD [ "/usr/local/bin/start.sh" ] + + diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..fe3dfa8 --- /dev/null +++ b/start.sh @@ -0,0 +1,26 @@ +#!/bin/bash +set -ex + +echo "Starting BIND initialization..." + +mkdir -p /etc/named + +# 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/ +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