caddy: Cannot build with caddy-dns/cloudflare
Hey team,
first of all apolagies for opening here. GH won’t let me open a ticket in caddy-dns/cloudflare
Problem Description
we use the following dockerfile to build our caddy image:
ARG CADDY_VERSION=2.9.1
FROM caddy:${CADDY_VERSION}-builder AS builder
# Extend caddy with:
# - caddy-docker-proxy: automatic docker label detection and on the fly reconfiguration
# - cloudflare: enable DNS challenges for cloudflare
RUN xcaddy build \
--with github.com/lucaslorentz/caddy-docker-proxy/v2 \
--with github.com/caddy-dns/cloudflare
FROM caddy:${CADDY_VERSION}-alpine
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
CMD ["caddy", "docker-proxy"]
Recently we started getting build errors:
> [builder 2/2] RUN xcaddy build --with github.com/lucaslorentz/caddy-docker-proxy/v2 --with github.com/caddy-dns/cloudflare:
0.176 2025/04/10 09:00:24 [INFO] absolute output file path: /usr/bin/caddy
0.176 2025/04/10 09:00:24 [INFO] Temporary folder: /tmp/buildenv_2025-04-10-0900.3004019819
0.176 2025/04/10 09:00:24 [INFO] Writing main module: /tmp/buildenv_2025-04-10-0900.3004019819/main.go
0.176 package main
0.176
0.176 import (
0.176 caddycmd "github.com/caddyserver/caddy/v2/cmd"
0.176
0.176 // plug in Caddy modules here
0.176 _ "github.com/caddyserver/caddy/v2/modules/standard"
0.176 _ "github.com/lucaslorentz/caddy-docker-proxy/v2"
0.176 _ "github.com/caddy-dns/cloudflare"
0.176 )
0.176
0.176 func main() {
0.176 caddycmd.Main()
0.176 }
0.176 2025/04/10 09:00:24 [INFO] Initializing Go module
0.177 2025/04/10 09:00:24 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod init caddy
0.184 go: creating new go.mod: module caddy
0.185 go: to add module requirements and sums:
0.185 go mod tidy
0.185 2025/04/10 09:00:24 [INFO] Pinning versions
0.185 2025/04/10 09:00:24 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -v github.com/caddyserver/caddy/v2@v2.9.1
0.321 go: downloading github.com/caddyserver/caddy/v2 v2.9.1
0.998 go: downloading github.com/caddyserver/certmagic v0.21.6
0.998 go: downloading github.com/cespare/xxhash/v2 v2.3.0
0.998 go: downloading github.com/google/uuid v1.6.0
0.998 go: downloading github.com/prometheus/client_golang v1.19.1
1.000 go: downloading github.com/quic-go/quic-go v0.48.2
1.135 go: downloading github.com/cespare/xxhash v1.1.0
1.442 go: downloading go.uber.org/zap v1.27.0
1.542 go: downloading go.uber.org/zap/exp v0.3.0
1.542 go: downloading golang.org/x/sys v0.28.0
2.431 go: downloading golang.org/x/term v0.27.0
2.431 go: downloading golang.org/x/time v0.7.0
2.524 go: downloading github.com/klauspost/cpuid/v2 v2.2.9
2.524 go: downloading github.com/caddyserver/zerossl v0.1.3
2.525 go: downloading github.com/libdns/libdns v0.2.2
2.534 go: downloading github.com/mholt/acmez/v3 v3.0.0
2.842 go: downloading github.com/miekg/dns v1.1.62
3.024 go: downloading github.com/zeebo/blake3 v0.2.4
3.025 go: downloading golang.org/x/crypto v0.31.0
3.025 go: downloading golang.org/x/net v0.33.0
3.026 go: downloading github.com/beorn7/perks v1.0.1
3.027 go: downloading github.com/prometheus/client_model v0.5.0
3.741 go: downloading github.com/prometheus/common v0.48.0
3.741 go: downloading google.golang.org/protobuf v1.35.1
3.741 go: downloading github.com/prometheus/procfs v0.12.0
4.097 go: downloading github.com/onsi/ginkgo/v2 v2.13.2
5.730 go: downloading go.uber.org/mock v0.4.0
5.730 go: downloading golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842
6.069 go: downloading github.com/quic-go/qpack v0.5.1
6.075 go: downloading go.uber.org/multierr v1.11.0
6.569 go: downloading github.com/francoispqt/gojay v1.2.13
6.593 go: downloading golang.org/x/tools v0.22.0
6.593 go: downloading golang.org/x/text v0.21.0
6.679 go: downloading golang.org/x/mod v0.18.0
7.339 go: downloading github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572
9.531 go: downloading github.com/google/pprof v0.0.0-20231212022811-ec68065c825e
11.12 go: downloading golang.org/x/sync v0.10.0
15.37 go: added github.com/beorn7/perks v1.0.1
15.37 go: added github.com/caddyserver/caddy/v2 v2.9.1
15.37 go: added github.com/caddyserver/certmagic v0.21.6
15.37 go: added github.com/caddyserver/zerossl v0.1.3
15.37 go: added github.com/cespare/xxhash/v2 v2.3.0
15.37 go: added github.com/francoispqt/gojay v1.2.13
15.37 go: added github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572
15.37 go: added github.com/google/pprof v0.0.0-20231212022811-ec68065c825e
15.37 go: added github.com/google/uuid v1.6.0
15.37 go: added github.com/klauspost/cpuid/v2 v2.2.9
15.37 go: added github.com/libdns/libdns v0.2.2
15.37 go: added github.com/mholt/acmez/v3 v3.0.0
15.37 go: added github.com/miekg/dns v1.1.62
15.37 go: added github.com/onsi/ginkgo/v2 v2.13.2
15.37 go: added github.com/prometheus/client_golang v1.19.1
15.37 go: added github.com/prometheus/client_model v0.5.0
15.37 go: added github.com/prometheus/common v0.48.0
15.37 go: added github.com/prometheus/procfs v0.12.0
15.37 go: added github.com/quic-go/qpack v0.5.1
15.37 go: added github.com/quic-go/quic-go v0.48.2
15.37 go: added github.com/zeebo/blake3 v0.2.4
15.37 go: added go.uber.org/mock v0.4.0
15.37 go: added go.uber.org/multierr v1.11.0
15.37 go: added go.uber.org/zap v1.27.0
15.37 go: added go.uber.org/zap/exp v0.3.0
15.37 go: added golang.org/x/crypto v0.31.0
15.37 go: added golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842
15.37 go: added golang.org/x/mod v0.18.0
15.37 go: added golang.org/x/net v0.33.0
15.37 go: added golang.org/x/sync v0.10.0
15.37 go: added golang.org/x/sys v0.28.0
15.37 go: added golang.org/x/term v0.27.0
15.37 go: added golang.org/x/text v0.21.0
15.37 go: added golang.org/x/time v0.7.0
15.37 go: added golang.org/x/tools v0.22.0
15.37 go: added google.golang.org/protobuf v1.35.1
15.37 2025/04/10 09:00:39 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -v github.com/lucaslorentz/caddy-docker-proxy/v2 github.com/caddyserver/caddy/v2@v2.9.1
15.68 go: downloading github.com/lucaslorentz/caddy-docker-proxy/v2 v2.9.2
15.75 go: downloading github.com/lucaslorentz/caddy-docker-proxy v0.3.6
15.79 go: downloading github.com/docker/docker v27.5.1+incompatible
15.79 go: downloading github.com/joho/godotenv v1.5.1
15.79 go: downloading github.com/aryann/difflib v0.0.0-20210328193216-ff5ff6dc229b
15.79 go: downloading github.com/spf13/cobra v1.8.1
15.79 go: downloading github.com/spf13/pflag v1.0.5
15.94 go: downloading go.uber.org/automaxprocs v1.6.0
15.96 go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20241104001025-71ed71b4faf9
17.50 go: downloading github.com/inconshreveable/mousetrap v1.1.0
18.32 go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.4
18.41 go: downloading gopkg.in/yaml.v3 v3.0.1
18.50 go: downloading github.com/russross/blackfriday/v2 v2.1.0
18.60 go: downloading github.com/russross/blackfriday v1.5.2
18.75 go: downloading github.com/smallstep/certificates v0.26.1
19.21 go: downloading github.com/smallstep/truststore v0.13.0
19.21 go: downloading go.step.sm/crypto v0.45.0
19.21 go: downloading github.com/go-chi/chi/v5 v5.0.12
19.55 go: downloading github.com/smallstep/nosql v0.6.1
19.55 go: downloading github.com/dustin/go-humanize v1.0.1
19.55 go: downloading gopkg.in/natefinch/lumberjack.v2 v2.2.1
19.55 go: downloading github.com/tailscale/tscert v0.0.0-20240608151842-d3f834017e53
19.55 go: downloading github.com/google/cel-go v0.21.0
19.98 go: downloading github.com/klauspost/compress v1.17.11
19.98 go: downloading github.com/pires/go-proxyproto v0.7.1-0.20240628150027-b718e7ce4964
19.98 go: downloading github.com/BurntSushi/toml v1.4.0
19.98 go: downloading github.com/alecthomas/chroma/v2 v2.14.0
19.98 go: downloading github.com/Masterminds/sprig/v3 v3.3.0
19.98 go: downloading github.com/yuin/goldmark v1.7.8
19.98 go: downloading github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
21.02 go: downloading go.opentelemetry.io/contrib/propagators/autoprop v0.42.0
21.02 go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.31.0
21.02 go: downloading go.opentelemetry.io/otel v1.31.0
21.02 go: downloading go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0
21.02 go: downloading go.opentelemetry.io/otel/sdk v1.31.0
21.52 go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0
21.70 go: downloading go.opentelemetry.io/otel/trace v1.31.0
21.84 go: downloading github.com/docker/go-connections v0.5.0
21.84 go: downloading github.com/docker/go-units v0.5.0
21.84 go: downloading github.com/moby/docker-image-spec v1.3.1
21.84 go: downloading github.com/distribution/reference v0.6.0
22.00 go: downloading github.com/opencontainers/go-digest v1.0.0
22.01 go: downloading github.com/opencontainers/image-spec v1.1.0
22.20 go: downloading github.com/pkg/errors v0.9.1
22.20 go: downloading howett.net/plist v1.0.0
22.20 go: downloading go.step.sm/cli-utils v0.9.0
22.22 go: downloading go.step.sm/linkedca v0.20.1
22.44 go: downloading google.golang.org/grpc v1.67.1
22.45 go: downloading github.com/slackhq/nebula v1.6.1
24.04 go: downloading github.com/fxamacker/cbor/v2 v2.6.0
24.04 go: downloading github.com/google/go-tpm v0.9.0
24.04 go: downloading github.com/smallstep/go-attestation v0.4.4-0.20240109183208-413678f90935
25.17 go: downloading google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9
25.17 go: downloading github.com/antlr4-go/antlr/v4 v4.13.0
25.43 go: downloading github.com/stoewer/go-strcase v1.2.0
25.73 go: downloading dario.cat/mergo v1.0.1
25.73 go: downloading github.com/Masterminds/goutils v1.1.1
25.76 go: downloading github.com/Masterminds/semver/v3 v3.3.0
25.85 go: downloading google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440
27.23 go: downloading github.com/huandu/xstrings v1.5.0
27.23 go: downloading github.com/mitchellh/copystructure v1.2.0
27.24 go: downloading github.com/shopspring/decimal v1.4.0
27.24 go: downloading github.com/spf13/cast v1.7.0
27.76 go: downloading github.com/felixge/httpsnoop v1.0.4
29.83 go: downloading go.opentelemetry.io/otel/metric v1.31.0
29.83 go: downloading go.opentelemetry.io/contrib/propagators/aws v1.17.0
29.84 go: downloading go.opentelemetry.io/contrib/propagators/b3 v1.17.0
29.84 go: downloading go.opentelemetry.io/contrib/propagators/jaeger v1.17.0
29.84 go: downloading go.opentelemetry.io/contrib/propagators/ot v1.17.0
29.95 go: downloading go.opentelemetry.io/proto/otlp v1.3.1
29.97 go: downloading google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53
30.04 go: downloading github.com/gogo/protobuf v1.3.2
30.05 go: downloading github.com/Microsoft/go-winio v0.6.0
30.23 go: downloading github.com/smallstep/pkcs7 v0.0.0-20231024181729-3b98ecc1ca81
30.23 go: downloading github.com/smallstep/scep v0.0.0-20231024192529-aee96d7ad34d
31.58 go: downloading github.com/go-jose/go-jose/v3 v3.0.3
32.35 go: downloading github.com/rs/xid v1.5.0
32.35 go: downloading github.com/urfave/cli v1.22.14
32.44 go: downloading filippo.io/edwards25519 v1.1.0
32.45 go: downloading github.com/chzyer/readline v1.5.1
32.45 go: downloading github.com/manifoldco/promptui v0.9.0
32.46 go: downloading github.com/sirupsen/logrus v1.9.3
32.62 go: downloading github.com/mitchellh/go-ps v1.0.0
32.69 go: downloading github.com/dgraph-io/badger v1.6.2
32.70 go: downloading github.com/dgraph-io/badger/v2 v2.2007.4
33.15 go: downloading go.etcd.io/bbolt v1.3.9
33.15 go: downloading github.com/go-sql-driver/mysql v1.7.1
33.15 go: downloading github.com/jackc/pgx/v4 v4.18.3
33.38 go: downloading github.com/x448/float16 v0.8.4
33.38 go: downloading github.com/google/go-tspi v0.3.0
33.47 go: downloading github.com/dlclark/regexp2 v1.11.0
33.48 go: downloading github.com/mitchellh/reflectwalk v1.0.2
33.80 go: downloading github.com/go-logr/logr v1.4.2
33.80 go: downloading github.com/go-logr/stdr v1.2.2
33.80 go: downloading github.com/cenkalti/backoff/v4 v4.3.0
33.80 go: downloading github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0
34.24 go: downloading github.com/go-kit/kit v0.13.0
34.24 go: downloading github.com/dgraph-io/ristretto v0.1.0
34.24 go: downloading github.com/golang/protobuf v1.5.4
34.38 go: downloading github.com/grpc-ecosystem/grpc-gateway v1.5.0
34.70 go: downloading github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13
34.71 go: downloading github.com/jackc/pgconn v1.14.3
34.78 go: downloading github.com/jackc/pgio v1.0.0
34.80 go: downloading github.com/jackc/pgproto3/v2 v2.3.3
34.80 go: downloading github.com/jackc/pgtype v1.14.0
34.81 go: downloading github.com/google/certificate-transparency-go v1.1.8-0.20240110162603-74a5dd331745
35.56 go: downloading github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96
35.56 go: downloading github.com/golang/snappy v0.0.4
35.61 go: downloading github.com/go-kit/log v0.2.1
35.66 go: downloading github.com/golang/glog v1.2.2
35.72 go: downloading github.com/jackc/chunkreader/v2 v2.0.1
35.75 go: downloading github.com/jackc/pgpassfile v1.0.0
35.77 go: downloading github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a
35.77 go: downloading github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
35.77 go: downloading github.com/go-logfmt/logfmt v0.6.0
35.80 go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
35.83 go: downloading github.com/mattn/go-colorable v0.1.13
35.91 go: downloading github.com/mattn/go-isatty v0.0.20
44.03 go: downloading google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda
48.55 go: added github.com/distribution/reference v0.6.0
48.55 go: added github.com/docker/docker v27.5.1+incompatible
48.55 go: added github.com/docker/go-connections v0.5.0
48.55 go: added github.com/docker/go-units v0.5.0
48.55 go: upgraded github.com/gogo/protobuf v1.1.1 => v1.3.2
48.55 go: added github.com/joho/godotenv v1.5.1
48.55 go: added github.com/lucaslorentz/caddy-docker-proxy/v2 v2.9.2
48.55 go: added github.com/moby/docker-image-spec v1.3.1
48.55 go: added github.com/opencontainers/go-digest v1.0.0
48.55 go: added github.com/opencontainers/image-spec v1.1.0
48.55 go: upgraded google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 => v0.0.0-20241015192408-796eee8c2d53
48.56 2025/04/10 09:01:12 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -v github.com/caddy-dns/cloudflare github.com/caddyserver/caddy/v2@v2.9.1
48.97 go: downloading github.com/caddy-dns/cloudflare v0.0.0-20250407183951-bbf79111721a
49.05 go: accepting indirect upgrade from github.com/libdns/libdns@v0.2.2 to v1.0.0-beta.1
49.06 go: downloading github.com/libdns/cloudflare v0.2.0
49.09 go: downloading github.com/libdns/libdns v1.0.0-beta.1
49.23 go: added github.com/caddy-dns/cloudflare v0.0.0-20250407183951-bbf79111721a
49.23 go: added github.com/libdns/cloudflare v0.2.0
49.23 go: upgraded github.com/libdns/libdns v0.2.2 => v1.0.0-beta.1
49.24 2025/04/10 09:01:13 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -v
49.69 2025/04/10 09:01:13 [INFO] Build environment ready
49.69 2025/04/10 09:01:13 [INFO] Building Caddy
49.69 2025/04/10 09:01:13 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy -e
49.71 go: downloading github.com/stretchr/testify v1.9.0
49.71 go: downloading gotest.tools/v3 v3.5.1
49.71 go: downloading go.uber.org/goleak v1.3.0
49.73 go: downloading github.com/onsi/gomega v1.29.0
50.16 go: downloading github.com/containerd/log v0.1.0
50.17 go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.27.0
50.17 go: downloading github.com/google/go-cmp v0.6.0
50.17 go: downloading github.com/zeebo/assert v1.1.0
50.17 go: downloading github.com/prashantv/gostub v1.1.0
50.25 go: downloading gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
50.25 go: downloading github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262
50.25 go: downloading github.com/davecgh/go-spew v1.1.1
50.33 go: downloading github.com/pmezard/go-difflib v1.0.0
50.33 go: downloading github.com/moby/term v0.5.0
50.33 go: downloading github.com/morikuni/aec v1.0.0
50.33 go: downloading github.com/alecthomas/assert/v2 v2.7.0
50.33 go: downloading github.com/google/go-tpm-tools v0.4.4
50.35 go: downloading github.com/peterbourgon/diskv/v3 v3.0.1
50.37 go: downloading github.com/schollz/jsonstore v1.1.0
50.38 go: downloading github.com/frankban/quicktest v1.14.6
50.38 go: downloading github.com/alecthomas/repr v0.4.0
50.82 go: downloading github.com/aws/aws-sdk-go-v2/config v1.27.13
50.82 go: downloading github.com/aws/aws-sdk-go-v2/service/kms v1.31.1
50.82 go: downloading cloud.google.com/go/kms v1.16.0
50.82 go: downloading github.com/googleapis/gax-go/v2 v2.12.4
50.92 go: downloading google.golang.org/api v0.180.0
50.98 go: downloading github.com/googleapis/gax-go v2.0.0+incompatible
51.11 go: downloading github.com/aws/aws-sdk-go-v2 v1.26.1
51.12 go: downloading cloud.google.com/go v0.112.1
51.12 go: downloading github.com/chzyer/test v1.0.0
51.29 go: downloading github.com/kr/pretty v0.3.1
51.38 go: downloading github.com/cockroachdb/apd v1.1.0
51.51 go: downloading github.com/gofrs/uuid v4.0.0+incompatible
51.51 go: downloading github.com/zeebo/pcg v1.0.1
51.51 go: downloading github.com/google/btree v1.1.2
51.51 go: downloading github.com/hexops/gotextdiff v1.0.3
51.53 go: downloading github.com/chzyer/logex v1.2.1
51.54 go: downloading github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65
51.55 go: downloading github.com/lib/pq v1.10.9
51.56 go: downloading github.com/kr/text v0.2.0
51.61 go: downloading github.com/rogpeppe/go-internal v1.13.1
51.62 go: downloading github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5
51.62 go: downloading github.com/aws/smithy-go v1.20.2
51.89 go: downloading github.com/aws/aws-sdk-go-v2/credentials v1.17.13
51.99 go: downloading github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1
51.99 go: downloading github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0
51.99 go: downloading github.com/aws/aws-sdk-go-v2/service/sso v1.20.6
51.99 go: downloading github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.0
51.99 go: downloading github.com/aws/aws-sdk-go-v2/service/sts v1.28.7
51.99 go: downloading cloud.google.com/go/iam v1.1.8
52.29 go: downloading cloud.google.com/go/longrunning v0.5.7
52.40 go: downloading github.com/OneOfOne/xxhash v1.2.2
52.42 go: downloading github.com/spaolacci/murmur3 v1.1.0
52.44 go: downloading github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5
52.46 go: downloading github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2
52.55 go: downloading github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7
63.62 go: downloading golang.org/x/oauth2 v0.22.0
63.62 go: downloading cloud.google.com/go/auth v0.4.1
63.62 go: downloading cloud.google.com/go/auth/oauth2adapt v0.2.2
63.62 go: downloading cloud.google.com/go/compute/metadata v0.5.0
63.62 go: downloading github.com/google/s2a-go v0.1.7
63.79 go: downloading cloud.google.com/go/compute v1.23.3
64.25 go: downloading go.opencensus.io v0.24.0
64.37 go: downloading go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0
64.37 go: downloading github.com/googleapis/enterprise-certificate-proxy v0.3.2
64.59 go: downloading github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
64.66 go: finding module for package github.com/Azure/go-ansiterm/winterm
64.66 go: finding module for package github.com/Azure/go-ansiterm
64.77 go: downloading github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c
64.81 go: found github.com/Azure/go-ansiterm in github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c
64.81 go: found github.com/Azure/go-ansiterm/winterm in github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c
64.89 2025/04/10 09:01:28 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /usr/bin/caddy -ldflags -w -s -trimpath -tags nobadger,nomysql,nopgx
71.53 # github.com/caddyserver/certmagic
71.53 /go/pkg/mod/github.com/caddyserver/certmagic@v0.21.6/solvers.go:386:9: invalid composite literal type libdns.Record
71.53 /go/pkg/mod/github.com/caddyserver/certmagic@v0.21.6/solvers.go:445:17: zrec.record.Type undefined (type libdns.Record has no field or method Type)
71.53 /go/pkg/mod/github.com/caddyserver/certmagic@v0.21.6/solvers.go:449:45: zrec.record.Name undefined (type libdns.Record has no field or method Name)
71.53 /go/pkg/mod/github.com/caddyserver/certmagic@v0.21.6/solvers.go:462:42: zrec.record.Type undefined (type libdns.Record has no field or method Type)
71.53 /go/pkg/mod/github.com/caddyserver/certmagic@v0.21.6/solvers.go:463:45: zrec.record.Value undefined (type libdns.Record has no field or method Value)
71.53 /go/pkg/mod/github.com/caddyserver/certmagic@v0.21.6/solvers.go:467:74: zrec.record.Value undefined (type libdns.Record has no field or method Value)
71.53 /go/pkg/mod/github.com/caddyserver/certmagic@v0.21.6/solvers.go:469:116: zrec.record.Name undefined (type libdns.Record has no field or method Name)
71.53 /go/pkg/mod/github.com/caddyserver/certmagic@v0.21.6/solvers.go:507:39: zrec.record.ID undefined (type libdns.Record has no field or method ID)
71.53 /go/pkg/mod/github.com/caddyserver/certmagic@v0.21.6/solvers.go:508:41: zrec.record.Name undefined (type libdns.Record has no field or method Name)
71.53 /go/pkg/mod/github.com/caddyserver/certmagic@v0.21.6/solvers.go:509:41: zrec.record.Type undefined (type libdns.Record has no field or method Type)
71.53 /go/pkg/mod/github.com/caddyserver/certmagic@v0.21.6/solvers.go:509:41: too many errors
76.34 2025/04/10 09:01:40 [INFO] Skipping cleanup as requested; leaving folder intact: /tmp/buildenv_2025-04-10-0900.3004019819
76.34 2025/04/10 09:01:40 [FATAL] exit status 1
------
Dockerfile:7
--------------------
6 | # - cloudflare: enable DNS challenges for cloudflare
7 | >>> RUN xcaddy build \
8 | >>> --with github.com/lucaslorentz/caddy-docker-proxy/v2 \
9 | >>> --with github.com/caddy-dns/cloudflare
10 |
--------------------
ERROR: failed to solve: process "/bin/sh -c xcaddy build --with github.com/lucaslorentz/caddy-docker-proxy/v2 --with github.com/caddy-dns/cloudflare" did not complete successfully: exit code: 1
Problem scope & resolution steps
The offending plugin when building is github.com/caddy-dns/cloudflare. If this plugin is removed, then the build completes successfully. The build fails on both arm and x86
We however use DNS challenges a lot, as they are part of our migration strategy so it’s a mandatory feature if we wish to continue with caddy.
Please advise.
Thanks!
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (8 by maintainers)
Don’t apologise! I and everyone else appreciate what you’ve built for us.
You’re always “pinning” versions in your builds when you compile a Go program (which is what xcaddy is doing). When you compile a Go program, its go.mod specifies which versions to use. If you don’t specify it,
gofills it out automatically. But it can’t know whether you want to downgrade this dependency or upgrade that one. You have to decide that, so the build doesn’t work until you do. That’s what the error is saying.The real issue is in your go.mod at this point (or the one that your xcaddy command is creating). Over time, things will start working again as stable versions of things are tagged/released, but I can’t tell you when that is because I don’t control your go.mod file. (These are the risks of using pre-1.0 software. Sorry. That’s why we’re making libdns a stable 1.0 soon, to avoid this.)
There is no resolution, it’s an actual API breakage which will require new releases for Caddy, Certmagic, the Cloudflare plugin, and libdns. So for now, you need to pin your build until everything gets a new release and things have settled.
Pin your build to a specific commit, as you would understand if you actually looked at the closed issues. For example
xcaddy build --with github.com/caddy-dns/cloudflare@188b4850c0f2f5565a6310810c936ea960e2210f