Closed ThinkChaos closed 3 years ago
If you want to use a different version, you should probably just specify it in the xcaddy
command, from your own Dockerfile.
xcaddy build <version> \
--with <plugin>
Yeah that's what I do, but my Dockerfile takes an ARG CADDY_VERSION
which doesn't work because ENV
always overrides ARG
.
So to avoid hardcoding the version in the Dockerfile, I have to change this (or use a different name - but meh).
EDIT: more specifically in my Dockerfile I call xcaddy $CADDY_VERSION
which ignores my ARG
and uses the ENV
defined here.
@ThinkChaos just use a different variable then, and do xcaddy build $CUSTOM_CADDY_VERSION
or something. xcaddy
always takes the argument as priority over the CADDY_VERSION
env.
@francislavoie I know, but I'm not satisfied with another name. "Custom" makes it sound like it's not an official Caddy release. I don't understand why this change would pose any issue as it makes the Dockerfile more flexible for downstream users with almost no cost. The Dockerfile reference even recommends the ARG+ENV approach.
Sorry @ThinkChaos but we can't accept this. Official images can't be built with ARG
instructions.
See also: https://github.com/caddyserver/caddy-docker/issues/108 and https://github.com/caddyserver/caddy-docker/pull/110
This change allows overriding it's value when building as ARGs can be set with --build-arg but ENVs can't.
I think it's safe to change
CADDY_VERSION
like so because xcaddy can build multiple caddy versions. I didn't changeXCADDY_VERSION
as that would break the checksum verification.