caddy-tailscale icon indicating copy to clipboard operation
caddy-tailscale copied to clipboard

Unable to build with xcaddy when paired with caddy-maxmind-geolocation.

Open xGigaa opened this issue 1 year ago • 1 comments

I seems to be unable to build caddy-tailscale with caddy-maxmind-geolocation. Building them separately works fine but if I build them together the build fails with:

26.54 2024/09/06 11:55:23 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /usr/bin/caddy -ldflags -w -s -trimpath -tags nobadger 
56.30 # tailscale.com/net/tstun
56.30 /go/pkg/mod/[email protected]/net/tstun/wrap.go:965:17: res.packet.IsNil undefined (type *stack.PacketBuffer has no field or method IsNil)
59.87 2024/09/06 11:55:56 [INFO] Skipping cleanup as requested; leaving folder intact: /tmp/buildenv_2024-09-06-1154.204774573
59.87 2024/09/06 11:55:56 [FATAL] exit status 1
------
failed to solve: process "/bin/sh -c xcaddy build     --with github.com/tailscale/caddy-tailscale     --with github.com/porech/caddy-maxmind-geolocation" did not complete successfully: exit code: 1

This is my Dockerfile:

FROM caddy:2.8.4-builder AS builder
RUN xcaddy build \
    --with github.com/tailscale/caddy-tailscale \
    --with github.com/porech/caddy-maxmind-geolocation
FROM caddy:2.8.4
COPY --from=builder /usr/bin/caddy /usr/bin/caddy

Maybe I'm doing something wrong here?

xGigaa avatar Sep 06 '24 12:09 xGigaa

the line of code that was causing that particular error was removed as of Tailscale v1.72 (in this commit to be precise). So could you tray again with a current version? Note that caddy-tailscale now requires caddy 2.9. This updated Dockerfile seems to work for me:

FROM docker.io/caddy:2.9-builder AS builder
RUN xcaddy build \
  --with github.com/tailscale/caddy-tailscale \
  --with github.com/porech/caddy-maxmind-geolocation
FROM docker.io/caddy:2.9
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
% docker run -t ae7cdb33b4939cd5d42f53a990154413a51bd6132278c43cf0fd8cf6c8e24d7f /usr/bin/caddy version
v2.9.1 h1:OEYiZ7DbCzAWVb6TNEkjRcSCRGHVoZsJinoDR/n9oaY=

willnorris avatar Feb 11 '25 22:02 willnorris