You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using multiple compose files with the -f option, each can define amendments to a service defined in a previous file. When the first two files define environment variables for a service, subsequent files are unable to use the !reset tag to remove these environment key value pairs, per the example at https://docs.docker.com/compose/compose-file/13-merge/#reset-value. If only one file defines environment key value pairs then another is able to reset them as expected.
This probably applies to other parts of the service definition but only the environment key was tested.
Steps To Reproduce
With the following files: test1.yml
services:
app:
image: myapp
ports:
- "8080:80"
environment:
FOO: BAR
environment is managed internally using the KEY=VALUE representation during the merge phase, this is why !reset doesn't work here. Not sure how this could be fixed...
would be nice if combining !reset and yaml anchors like the following worked:
anchor is a yaml syntax fature, applied by the low level yaml parser. This takes place before we merge yaml files together, so this is not possible
Description
When using multiple compose files with the
-f
option, each can define amendments to a service defined in a previous file. When the first two files define environment variables for a service, subsequent files are unable to use the!reset
tag to remove these environment key value pairs, per the example at https://docs.docker.com/compose/compose-file/13-merge/#reset-value. If only one file defines environment key value pairs then another is able to reset them as expected.This probably applies to other parts of the service definition but only the
environment
key was tested.Steps To Reproduce
With the following files:
test1.yml
test2.yml
override.yml
Run
docker compose -f test1.yml -f test2.yml -f override.yml config
Resulting in: (directory run in was named
tests
)Expected result would be:
Compose Version
Docker Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: