1
0
Fork 0
mirror of https://github.com/Luzifer/dns.git synced 2024-12-22 19:01:20 +00:00

Add custom build of coredns

This commit is contained in:
Knut Ahlers 2018-01-30 23:26:44 +01:00
commit 59f754d910
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
2 changed files with 45 additions and 0 deletions

20
Dockerfile Normal file
View file

@ -0,0 +1,20 @@
FROM golang:alpine
ADD ./build.sh /usr/local/bin/build.sh
RUN set -ex \
&& apk --no-cache add git bash \
&& bash /usr/local/bin/build.sh
FROM alpine
LABEL maintainer Knut Ahlers <knut@ahlers.me>
COPY --from=0 /go/bin/coredns /usr/local/bin/
ADD . /src
WORKDIR /src
EXPOSE 53/udp
ENTRYPOINT ["/usr/local/bin/coredns"]
CMD ["--"]

25
build.sh Normal file
View file

@ -0,0 +1,25 @@
#!/bin/bash
set -euxo pipefail
IFS=$'\n'
GOPKGS=(
'github.com/coredns/coredns'
'github.com/Luzifer/alias'
)
for pkg in ${GOPKGS[@]}; do
go get -d -v "${pkg}"
done
PLUGINS=(
'/^file:file/ i alias:github.com/Luzifer/alias'
)
cd /go/src/github.com/coredns/coredns
for insert in ${PLUGINS[@]}; do
sed -i "${insert}" plugin.cfg
done
go generate
go install