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:
commit
59f754d910
2 changed files with 45 additions and 0 deletions
20
Dockerfile
Normal file
20
Dockerfile
Normal 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
25
build.sh
Normal 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
|
Loading…
Reference in a new issue