Open deubert-it opened 7 months ago
Same problem!
Also here the problem 😪
push - same issue here
Same here
This looks to be some incompatibility in compose config
and the compose spec not being backward compatible with the v3 schema; it looks like this commit introduced numeric values into the compose spec, but for some reason compose config also uses that as a default, which makes the converted file incompatible with the v3 schema; https://github.com/compose-spec/compose-spec/commit/2808cef031c15d57f52b2955a51fc71ce1dd1eb2
There's a pending PR to switch docker stack
to use the compose-schema, but we need to look at incompatibilities like this, as these would break backward compatibility with existing systems;
up
Same here. It works well via sed.
$ docker compose config | sed -e 's/cpus:\s\(.*\)/cpus: "\1"/' | docker stack deploy --compose-file - [YOUR_STACK_NAME]
Description
We used docker-ce 26.0.0 before (former debian 11 default package), and after the upgrade to 26.0.1 (current debian 11 stable package as of last night) our stack deployments fail with something like "services.agent.deploy.resources.limits.cpus must be a string"
We usually do something like
docker compose config | .. | docker stack deploy
, this worked with docker 26.0.0 and docker compose 2.25.0 but does not work with docker 26.0.1 and docker compose 2.26.1 anymore.My initial thought was that it was related to docker compose, so I opened this issue: https://github.com/docker/compose/issues/11721 As it seems not to be related with compose, I was pointed to this repository.
I checked the compose spec and it still seems to allow "number", "string": https://github.com/compose-spec/compose-spec/blob/master/schema/compose-spec.json#L519
Reproduce
config:
Trying to deploy this via docker stack deploy will result in "services.agent.deploy.resources.limits.cpus must be a string" and the deployment will fail.
Expected behavior
Using docker stack deploy with the config above should work
docker version
docker info
Additional Info
No response