Commit c448d92e authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Initial commit

parents
Loading
Loading
Loading
Loading
Loading

.gitlab-ci.yml

0 → 100644
+40 −0
Original line number Diff line number Diff line
variables:
  BIND9_VERSION:
    value: 9.16.23
    description: BIND release

build:
  stage: build
  image: docker.kodo.org.uk/ci-images/buildkit/buildctl:latest
  tags: [buildkit]
  rules:
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
  - if: $CI_PIPELINE_SOURCE == "schedule"
  - if: $CI_PIPELINE_SOURCE == "merge_request_event"
  script:
  - BUILD_TAG=${CI_REGISTRY_IMAGE}:build-${CI_PIPELINE_IID}
  - buildctl build
    --frontend=dockerfile.v0
    --local context=.
    --local dockerfile=.
    --opt build-arg:BIND9_VERSION=${BIND9_VERSION}
    --opt label:bind9.version=${BIND9_VERSION}
    --opt platform=linux/amd64,linux/arm64
    --output type=image,name=${BUILD_TAG},push=true

tag:
  stage: deploy
  image: docker.kodo.org.uk/ci-images/docker-reg:latest
  rules:
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
    variables:
      TAG: latest
  - if: $CI_COMMIT_BRANCH == "develop"
    variables:
      TAG: unstable
  script: |
    BUILD_TAG=${CI_REGISTRY_IMAGE}:build-${CI_PIPELINE_IID}
    docker-reg $BUILD_TAG retag $TAG
    if [ $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH ]; then
      docker-reg $BUILD_TAG retag $BIND9_VERSION
    fi

Dockerfile

0 → 100644
+31 −0
Original line number Diff line number Diff line
FROM debian:latest AS build

COPY --from=docker.kodo.org.uk/kodo.org.uk/docker/docker-build-helpers:latest \
    /scripts /bin
RUN apt-get update && apt-get install -y \
    curl \
    build-essential \
    libjemalloc-dev \
    libnghttp2-dev \
    libssl-dev \
    libuv1-dev

WORKDIR /src
ARG BIND9_VERSION=9.16.23
RUN curl https://downloads.isc.org/isc/bind9/${BIND9_VERSION}/bind-${BIND9_VERSION}.tar.xz \
  | tar -xJf- --strip-components=1

RUN ./configure --disable-linux-caps --without-python --prefix=/
RUN make
RUN make install

RUN stage-useradd bind
RUN collect-binaries /sbin/named
RUN mkdir -p /stage/etc/bind /stage/var/run/named
RUN chown 1:1 /stage/var/run/named


FROM scratch
COPY --from=build /stage/ /
WORKDIR /var/run/named
ENTRYPOINT ["/sbin/named", "-g", "-ubind", "-c/etc/bind/named.conf"]