Browse Source

initial impl

master
Jan Christian Grünhage 3 years ago
parent
commit
f9a9cbf755
  1. 4
      .drone.yml
  2. 31
      Dockerfile
  3. 4
      README.md
  4. 1
      docker/root/etc/s6.d/coredns/finish
  5. 4
      docker/root/etc/s6.d/coredns/run

4
.drone.yml

@ -1,7 +1,7 @@
pipeline:
docker:
image: plugins/docker
repo: docker.jcg.re/template
registry: docker.jcg.re
repo: docker.io/jcgruenhage/coredns
registry: docker.io
secrets: [ docker_username, docker_password ]
tags: latest

31
Dockerfile

@ -1,12 +1,41 @@
FROM docker.io/alpine:3.8
LABEL maintainer="Jan Christian Grünhage <jan.christian@gruenhage.xyz"
ARG COREDNS_VERSION=1.2.2
ENV UID=1337 \
GID=1337
RUN apk add --no-cache \
s6 \
su-exec
su-exec \
unbound-libs \
ca-certificates \
libcap \
&& apk add --no-cache \
-t .build-deps \
unbound-dev \
build-base \
go \
tar \
coreutils \
git \
&& export GOPATH=/tmp/gopath \
&& mkdir -p ${GOPATH}/src/github.com/coredns \
&& cd ${GOPATH}/src/github.com/coredns \
&& wget https://github.com/coredns/coredns/archive/v${COREDNS_VERSION}.tar.gz \
&& tar xf v${COREDNS_VERSION}.tar.gz \
&& mv coredns-${COREDNS_VERSION} coredns \
&& cd coredns \
&& echo "unbound:github.com/coredns/unbound" >> plugin.cfg \
&& go get -d github.com/coredns/unbound \
&& make CHECKS= godeps gen \
&& go build \
&& install -o root -g root -m +x ./coredns /usr/local/bin/coredns \
&& setcap cap_net_bind_service=+ep /usr/local/bin/coredns \
&& cd / \
&& apk del .build-deps \
&& rm -rf /tmp/gopath
COPY docker/root /

4
README.md

@ -1,3 +1,3 @@
## docker.jcg.re/template
## docker.io/jcgruenhage/coredns
This is a template repository for new dockerizations
Simple docker container for coredns with unbound support

1
docker/root/etc/s6.d/coredns/finish

@ -0,0 +1 @@
#!/bin/sh

4
docker/root/etc/s6.d/coredns/run

@ -0,0 +1,4 @@
#!/bin/sh
cd /data
chown -R ${UID}:${GID} /data
su-exec ${UID}:${GID} coredns -conf /data/Corefile
Loading…
Cancel
Save