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

Update to golang v1.22 for builder base

Open sam-lord opened this issue 10 months ago • 6 comments

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

sam-lord avatar Apr 17 '24 12:04 sam-lord

Also intersted in that!

acouvreur avatar Apr 28 '24 14:04 acouvreur

@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!

brotbert avatar May 14 '24 13:05 brotbert

@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

mholt avatar May 14 '24 13:05 mholt

@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

brotbert avatar May 14 '24 14:05 brotbert

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.

francislavoie avatar May 14 '24 14:05 francislavoie

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

brotbert avatar May 14 '24 14:05 brotbert

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

francislavoie avatar May 29 '24 21:05 francislavoie