Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not build with CoreDNS 1.11.1 #38

Open
p3lim opened this issue Feb 5, 2024 · 0 comments
Open

Does not build with CoreDNS 1.11.1 #38

p3lim opened this issue Feb 5, 2024 · 0 comments

Comments

@p3lim
Copy link

p3lim commented Feb 5, 2024

Using your image I tried to bump the CoreDNS version to 1.11.1.
CoreDNS requires Go 1.20 to compile, so I bumped that too.
The Go build images don't come with gcc any more, so I added build-base.

diff --git a/Dockerfile b/Dockerfile
index 559a327..1b729ee 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,16 +1,18 @@
-ARG GOLANG_VERS=1.18
+ARG GOLANG_VERS=1.20
 ARG ALPINE_VERS=3.17

 FROM golang:${GOLANG_VERS}-alpine${ALPINE_VERS}

 ARG CGO_ENABLED=1
 ARG PLUGIN_PRIO=50
-ARG COREDNS_VERS=1.10.1
+ARG COREDNS_VERS=1.11.1

 RUN go mod download github.com/coredns/coredns@v${COREDNS_VERS}
 WORKDIR $GOPATH/pkg/mod/github.com/coredns/coredns@v${COREDNS_VERS}
 RUN go mod download

+RUN apk add --no-cache build-base
+
 COPY --link ./ $GOPATH/pkg/mod/github.com/kevinjqiu/coredns-dockerdiscovery
 RUN sed -i "s/^#.*//g; /^$/d; $PLUGIN_PRIO i docker:dockerdiscovery" plugin.cfg \
     && go mod edit -replace\

Following that I get this error when building:

 => ERROR [stage-0 7/7] RUN sed -i "s/^#.*//g; /^$/d; 50 i docker:dockerdiscovery" plugin.cfg     && go mod edit  18.8s
------
 > [stage-0 7/7] RUN sed -i "s/^#.*//g; /^$/d; 50 i docker:dockerdiscovery" plugin.cfg     && go mod edit -replace    dockerdiscovery=/go/pkg/mod/github.com/kevinjqiu/coredns-dockerdiscovery    && go generate coredns.go && go build -mod=mod -o=/usr/local/bin/coredns &&     apk --no-cache add binutils && strip -vs /usr/local/bin/coredns:
18.45 # github.com/coredns/coredns/core/plugin
18.45 core/plugin/zplugin.go:7:4: could not import dockerdiscovery (open : no such file or directory)
------
Dockerfile:17
--------------------
  16 |     COPY --link ./ $GOPATH/pkg/mod/github.com/kevinjqiu/coredns-dockerdiscovery
  17 | >>> RUN sed -i "s/^#.*//g; /^$/d; $PLUGIN_PRIO i docker:dockerdiscovery" plugin.cfg \
  18 | >>>     && go mod edit -replace\
  19 | >>>     dockerdiscovery=$GOPATH/pkg/mod/github.com/kevinjqiu/coredns-dockerdiscovery\
  20 | >>>     && go generate coredns.go && go build -mod=mod -o=/usr/local/bin/coredns && \
  21 | >>>     apk --no-cache add binutils && strip -vs /usr/local/bin/coredns
  22 |
--------------------
ERROR: failed to solve: process "/bin/sh -c sed -i \"s/^#.*//g; /^$/d; $PLUGIN_PRIO i docker:dockerdiscovery\" plugin.cfg     && go mod edit -replace    dockerdiscovery=$GOPATH/pkg/mod/github.com/kevinjqiu/coredns-dockerdiscovery    && go generate coredns.go && go build -mod=mod -o=/usr/local/bin/coredns &&     apk --no-cache add binutils && strip -vs /usr/local/bin/coredns" did not complete successfully: exit code: 1
@p3lim p3lim changed the title Does not work with CoreDNS 1.11.1 Does not build with CoreDNS 1.11.1 Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant