-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile.build
21 lines (20 loc) · 877 Bytes
/
Dockerfile.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FROM golang:1.18 AS build-stage
ARG corednsVersion=1.10.0
RUN wget https://github.com/coredns/coredns/archive/refs/tags/v${corednsVersion}.tar.gz
ADD . /go/coredns-auto-ipv6-ptr-master/
RUN tar xzf v${corednsVersion}.tar.gz
WORKDIR /go/coredns-${corednsVersion}
RUN ln -s /go/coredns-auto-ipv6-ptr-master plugin/autoipv6ptr
RUN echo "autoipv6ptr:autoipv6ptr" > plugin.cfg
RUN echo "secondary:secondary" >> plugin.cfg
RUN echo "file:file" >> plugin.cfg
RUN echo "log:log" >> plugin.cfg
RUN echo "bind:bind" >> plugin.cfg
RUN go generate coredns.go
RUN go mod edit -replace github.com/coredns/coredns/plugin/autoipv6ptr=$(pwd)/plugin/autoipv6ptr
RUN go get
RUN GOOS=linux GOARCH=amd64 go build -o coredns .
#RUN GOOS=darwin GOARCH=arm64 go build -o coredns .
FROM scratch AS export-stage
ARG corednsVersion=1.10.0
COPY --from=build-stage /go/coredns-${corednsVersion}/coredns /