-
Notifications
You must be signed in to change notification settings - Fork 256
Define service config hash #935
Comments
docker-compose creates hash from compact, ordered-by-key json for service config {"image_id":"sha256:xxx","links":[],"net":"xxx","networks":{"xxx":{}},"options":{"image":"xx","mem_limit":"xx","platform":null,"ports":[[80,null,null,null,null]],"volumes":[]},"secrets":[],"volumes_from":[]}
|
Seems its possible to calculate diff between docker-compose file and actual container created on dockerd.
and
, but its not implemented in compose-cli yet. Is "something" similar on the roadmap ? Related: https://github.com/docker/compose-cli/issues/1090 Thanks |
@lukasmrtvy this Remaining issue I'm investigating is that the hash computed by docker-compose is not the same, which will trigger containers being re-created for users who use both tools together (probably because they miss some command we didn't yet implemented). By the way, I'd be happy to hear your use-case for this command. Hash seems to me to be just internal "implementation detail". Is it just for you to guess if running app is in sync with your compose file, or |
Oh, sweet ! Comparing hashes or having some dry mode ( #1090 ) will give You a chance to decide what to do ( without actually touching containers ). For example:
|
While the With As best as I can tell, this is due to The path expansion probably makes sense, and could be added in as a step in Whether it is by allowing these hashes to match, or by implementing a completely new dry run system like #8551 (though I suspect matching the hash mechanisms will be easier), providing a mechanism for external tools to determine if a container is running from an outdated config would be very useful. |
Description
Compose "convergence" (actual vs expected state reconciliation) is based on comparing container label
com.docker.compose.config-hash
with currentcompose.yaml
service definition.This one includes some service configuration that should be ignored, like
Scale
and some of thedeploy
attributes.Also, we need to ensure interoperability with docker-compose, so this config-hash should be define in a consistent way by both tools
The text was updated successfully, but these errors were encountered: