Description
docker-compose config removes required yaml quoting
For example, a value - 'X=somevalue will be transformed by docker-compose config to - X=somevalue, with no quotes.
This is not a problem with simple values, but becomes a problem with utf-8 values, like 'André Kraus' or 'Mück' and you end up with invalid yaml.
This problem exists in both docker-compose v1 and docker-compose v2, all versions AFAICT
Steps to reproduce the issue:
Use this docker-compose.yaml:
services:
web:
image: busybox
environment:
- 'SOMEENV=André Kraus'
docker-compose config (either v1 or v2) will transform it to
services:
web:
environment:
SOMEENV: André Kraus
image: busybox
networks:
default: null
networks:
default:
name: ddev_default
which for some values of SOMEENV will result in invalid yaml and ".UnicodeDecodeError 'utf8-8' codec can't decode"
Describe the results you received:
Invalid yaml due to removal of quotes
Describe the results you expected:
Why not keep the quotes on there?
Additional information you deem important (e.g. issue happens only occasionally):
Output of docker-compose --version:
I have tested this on Windows to get failure with this setup.
- docker-compose v2.0.0-rc.1 gets "yaml: invalid trailing UTF-8 octet" when you try to use
docker-compose -f dc.yaml up with a file created by docker-compose conf > dc.yaml
- docker-compose 1.29.2 with
docker-compose config >dc.yaml and docker-compose -f dc.yaml up gets ".UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 56: invalid continuation byte"
On macOS I get other problems, but not a complete failure like this.
Anyway, leave the quotes on!