caddyserver / caddy-docker

Source for the official Caddy v2 Docker Image
https://hub.docker.com/_/caddy
Apache License 2.0
398 stars 73 forks source link

Update to golang v1.22 for builder base #334

Closed sam-lord closed 1 month ago

sam-lord commented 3 months ago

I'm attempting to build a docker container with the experimental Tailscale plugin: https://github.com/tailscale/caddy-tailscale

My issue is that trying to build with a Dockerfile like this errors because the version of Golang is v1.21, and v1.22 is required for caddy-tailscale:

FROM caddy:2.7.6-builder AS builder

RUN xcaddy build \
    --with github.com/tailscale/caddy-tailscale

FROM caddy:2

COPY --from=builder /usr/bin/caddy /usr/bin/caddy
acouvreur commented 2 months ago

Also intersted in that!

brotbert commented 2 months ago

@mholt Any plans to bump golang in the builder image? Our build also broke after your recent commits in caddy-ratelimit and bumping the required golang to v1.22 (see here). Thanks!

mholt commented 2 months ago

@brotbert Dependabot broke the build; my follow-up commit fixed the build except for those using old caddy versions apparently. The latest commit actually makes it work for old Caddy versions too: 2d18cd2c76cc5578483450f44f417bca8764a8bc

brotbert commented 2 months ago

@mholt We appreciate the quick feedback on it, but unfortunately it still doesn't work because of the minimum required golang version: https://github.com/mholt/caddy-ratelimit/blob/master/go.mod#L3

See also for reference: https://go.dev/doc/modules/gomod-ref#go

francislavoie commented 2 months ago

Any plans to bump golang in the builder image?

No, but you can use the 2.8.0-beta.2 builder image which has Go 1.22.

But I agree the caddy-ratelimit go.mod should be fully reverted to allow building with Go 1.21.

brotbert commented 2 months ago

@francislavoie Ah, thanks for the idea. Currently we decided to pin the caddy-ratelimit to the last working commit revision 359636d470b54958bdf331ff9c687192ba348daa.

francislavoie commented 1 month ago

We're using Go 1.22 for Caddy v2.8.0 which is releasing now