docker-compose-viz
docker-compose-viz copied to clipboard
YAML anchor throws error
As @Xenira stated in #33 , the project has an issue if compose extension fields are used. invalid example:
x-environment:
&default-tz-puid-pgid
TZ: $TZ
PUID: $PUID
PGID: $PGID
services:
service1:
environment:
<<: *default-tz-puid-pgid
Key0: Value0
...
valid example
x-environment:
&default-tz-puid-pgid
TZ: $TZ
PUID: $PUID
PGID: $PGID
services:
service1:
environment:
<<: &default-tz-puid-pgid
Key0: Value0
...
The error thrown would be:
In functions.php line 41:
File "docker-compose.yml" does not contain valid YAML
In Parser.php line 476:
Unable to parse at line 21 (near "<< * default-tz-puid-pgid").
To me it looks like the filter/search value for the yaml merge is not perfect.
If you change <<: *networking-reference
to << : &networking-reference
no error is thrown but its not a valid yaml/compose-file anymore.
So the script is happy with defining a yaml anchor (&) but not using it (*)
Further information on using yaml anchor in compose
Seems to be a Symfony error. So it seems we have to wait till docker-compose or symfony adjust.