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

Docker Recommendations for label syntax exclude underscores

Open TechplexEngineer opened this issue 3 years ago • 4 comments
trafficstars

The docker recommendations for label syntax say that "Label keys should begin and end with a lower-case letter and should only contain lower-case alphanumeric characters, the period character (.), and the hyphen character (-)." https://docs.docker.com/config/labels-custom-metadata/

I am trying to use Balena to deploy Caddy with some other services that it reverse proxies. The label "caddy.reverse_proxy" is invalid per the validation in the Balena tool.

My first thought is to allow "hyphens" where underscores are used and convert them before rendering the caddy file.

I'd appreciate any thoughts.

Related thread on Balena Forum: https://forums.balena.io/t/docker-compose-label-constraints/55756

TechplexEngineer avatar May 12 '22 14:05 TechplexEngineer

Yeah I'd say Balena should fix it. They're being overly restrictive for no good reason. It's always worked with underscores 🤷‍♂️

francislavoie avatar May 12 '22 14:05 francislavoie

I agree with you, however I'm at their mercy. Would you be interested in a PR with a small change support hyphens as a replacement for underscores?

This seems like a pretty trivial change. The tests pass, but I'm not a caddy expert, are there any special cases we need to be sure to handle? https://github.com/TechplexEngineer/caddy-docker-proxy/pull/1/files

TechplexEngineer avatar May 12 '22 15:05 TechplexEngineer

That's gross. It really limits future use of - for another purpose later. Not a fan. I'd rather see if Balena would acquiesce to a change first.

francislavoie avatar May 12 '22 15:05 francislavoie

I've submitted a support ticket, but given the age of that forum post, I'm not hopeful.

TechplexEngineer avatar May 12 '22 15:05 TechplexEngineer