1
0
mirror of https://github.com/Luzifer/dns.git synced 2024-09-19 15:23:03 +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