-
Notifications
You must be signed in to change notification settings - Fork 44
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
README example fails to build against matching Caddy version #34
Comments
It looks like the toolchain bump got removed in 7b5a952. But caddy-tailscale still requires go1.22, so it won't build on It does look like the caddy 2.8 builder has updated to go1.22, so you could try that now even though 2.8 is still in beta. |
/cc @mohammed90 @francislavoie I thought by downgrading we wouldn't be blocking out plugins but rather allowing the others to build 🤔 |
Our builder image of 2.7.6 ships with go1.21. The requirement for go1.22 isn't from Caddy; it's caddy-tailscale, so the builder image fails to build it because the plugin requires higher version than installed (in the container). This isn't on Caddy to act on |
Ah, a Docker thing. Got it. |
Well Line 3 in 4d681ef
go.mod ? Does the actual tailscale dependency itself require 1.22?
Anyway yeah, using the 2.8.0-beta.2 builder image is perfectly fine too. |
Yes, Tailscale pretty much always requires the latest go. We often run betas internally, but don't update our public dependency until stable releases. But we're pretty quick to update. |
We are now building against Caddy 2.8, so moving to the 2.8 builder image should solve this for you, since it has go1.22. That said, it's important to note that you will likely run into this again at some point in the future. Tailscale is generally pretty aggressive about updating to the latest stable go release as soon as it releases, which means that the caddy-tailscale plugin will not be far behind. Caddy is generally more conservative when it comes to bumping minimum go versions, so you might need to consider other ways of building your images. |
This Dockerfile seemed to work well for me, building xcaddy from source rather than using the caddy-builder image: FROM golang:1 AS builder
RUN go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
ENV XCADDY_SETCAP 0
RUN xcaddy build v2.8.4 --with github.com/tailscale/caddy-tailscale@main --output /usr/bin/caddy
FROM caddy:2.8
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
COPY examples/simple.caddyfile /etc/caddy/Caddyfile (For my personal site, I generally prefer the chainguard images rather than alpine and use my own main package, but any of these will work) |
I don't think there is anything more to do here, so I'm going to close this. However, feel free to continue discussing if here is actually something else we should do. One possible option would be to provide a ready-to-go Dockerfile (maybe the above one?) as requested in #14 |
It appears that trying to compile this module into Caddy using the matching Caddy docker image is not working:
Results in the following build error:
Relates to:
It appears that this commit 0f105e89fbe2222c690b94b5b0b2a8150fa2540f introduces the Go toolchain bump. I was able to get past this by pinning to a specific commit prior to the Go toolchain bump:
The text was updated successfully, but these errors were encountered: