JoeG
JoeG

Reputation: 7642

Docker-compose: display effective configuration?

Both the docker and docker-compose documentation discuss usage of multiple yaml files as a means to customize configuration. Functionally this all works great. Originally there was this:

docker-compose -f standard-run-docker-compose.yml up -d

and

docker-compose -f debug-run-docker-compose.yml up -d

as you would suspect there was almost complete overlap between the two yaml files. For example, service2 in the debug yml was only different because of the environment section:

service2:
  environment: {MAX_MEMORY: 2048m, CATALINA_OPTS: '-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=16543' }

This change lowers the amount of memory compared with the production setting and adds the parameters required to start in debug mode. To improve I did:

docker-compose -f docker-compose.std.yml -f docker-compose.debug.yml up -d

It seems to work perfectly - the second file only contains the changes - thus there is no more overlap of data, it is DRY. However, when I do:

docker-compose config

It does not give me the config of the actual RUNNING configuration, rather it simply gives the config of the first yaml file. In order to test, I want to be able to compare the original debug config with my multiple file one. Is there any way to output that "effective" config from docker-compose? I am running version 1.20.

Upvotes: 3

Views: 1209

Answers (1)

JoeG
JoeG

Reputation: 7642

Sorry, I was so lame! Yes, this works:

docker-compose -f docker-compose.std.yml -f docker-compose.debug.yml config

FWIW, that docker-compose has WAY more many downvotes than up! :)

Upvotes: 4

Related Questions