caddy-dns / cloudflare

Caddy module: dns.providers.cloudflare
Apache License 2.0
436 stars 59 forks source link

Error building with cloudflare dns and xcaddy (i/o timeout) #49

Closed Austin-s-h closed 1 year ago

Austin-s-h commented 1 year ago

Hi and thanks for helping to maintain an awesome service! I have been running into some issues building caddy with cloudflare dns enabled. I've set up my Dockerfile for caddy and I'm running it from a docker-compose yaml. This might be related to #11 , but the actual error is different and pinning the latest versions fails. I'll also try specifically with 2.2

FROM caddy:2.6.2-builder AS builder

RUN xcaddy build master --with github.com/caddy-dns/cloudflare@latest

FROM caddy:2.6.2

COPY --from=builder /usr/bin/caddy /usr/bin/caddy
[+] Building 11.1s (7/8)
 => [internal] load build definition from Dockerfile                                                                                       0.0s
 => => transferring dockerfile: 220B                                                                                                       0.0s 
 => [internal] load .dockerignore                                                                                                          0.0s 
 => => transferring context: 2B                                                                                                            0.0s 
 => [internal] load metadata for docker.io/library/caddy:2.6.2                                                                             0.5s
 => [internal] load metadata for docker.io/library/caddy:2.6.2-builder                                                                     0.5s 
 => CACHED [stage-1 1/2] FROM docker.io/library/caddy:2.6.2@sha256:39f1da8bd9f6405dc7f085062d532aee5abb3cb64a7526c5f468e15aa2525f89        0.0s
 => CACHED [builder 1/2] FROM docker.io/library/caddy:2.6.2-builder@sha256:bc8001ca9fc81b64f12b6ef7475733c075d5a4241fe7492691ab22307396d5  0.0s 
 => ERROR [builder 2/2] RUN xcaddy build master --with github.com/caddy-dns/cloudflare@latest                                             10.5s 
------
 > [builder 2/2] RUN xcaddy build master --with github.com/caddy-dns/cloudflare@latest:
#0 0.424 2022/12/28 14:13:24 [INFO] Temporary folder: /tmp/buildenv_2022-12-28-1413.85243573
#0 0.424 2022/12/28 14:13:24 [INFO] Writing main module: /tmp/buildenv_2022-12-28-1413.85243573/main.go
#0 0.424 package main
#0 0.424 
#0 0.424 import (
#0 0.424        caddycmd "github.com/caddyserver/caddy/v2/cmd"
#0 0.424
#0 0.424        // plug in Caddy modules here
#0 0.424        _ "github.com/caddyserver/caddy/v2/modules/standard"
#0 0.424        _ "github.com/caddy-dns/cloudflare"
#0 0.424 )
#0 0.424
#0 0.424 func main() {
#0 0.424        caddycmd.Main()
#0 0.424 }
#0 0.424 2022/12/28 14:13:24 [INFO] Initializing Go module
#0 0.424 2022/12/28 14:13:24 [INFO] exec (timeout=10s): /usr/local/go/bin/go mod init caddy
#0 0.430 go: creating new go.mod: module caddy
#0 0.432 go: to add module requirements and sums:
#0 0.432        go mod tidy
#0 0.433 2022/12/28 14:13:24 [INFO] Pinning versions
#0 0.433 2022/12/28 14:13:24 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/caddyserver/caddy/v2@master
#0 10.45 go: github.com/caddyserver/caddy/v2@master: invalid version: Get "https://proxy.golang.org/github.com/caddyserver/caddy/v2/@v/master.info": dial tcp: lookup proxy.golang.org on 192.168.65.5:53: read udp 172.17.0.2:54138->192.168.65.5:53: i/o timeout
#0 10.45 2022/12/28 14:13:34 [FATAL] exit status 1
------
failed to solve: executor failed running [/bin/sh -c xcaddy build master --with github.com/caddy-dns/cloudflare@latest]: exit code: 1
Austin-s-h commented 1 year ago

I believe this might actually have to do with the reference of the github repo. It's looking for https://github.com/caddyserver/caddy/v2 but the actual caddyserver repo has been renamed to https://github.com/caddyserver/caddy/

tiger5226 commented 1 year ago

doh, its missing as a module when you try to download it from caddyserver too. I came here to try to just build it myself. So I assume the caddyserver.com infrastructure also cannot build it properly.

mholt commented 1 year ago

Not sure what the issue is -- works for me; but just in case I tried updating dependencies in case that helps. (go.mod)