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
services.ttt-test-pg.volumes.0.read_only must be a boolean
This issue did not occur in v2.16.
Steps To Reproduce
Windows 10
Docker compose v2.17.0
Copy the above compose.yml
Then docker compose build
You will see the error
Compose Version
Docker: Docker version 20.10.24, build 297e128
Compose: Docker Compose version v2.17.2 @ Windows 10
Docker Environment
No response
Anything else?
Like #10411, it seems that the update to go-yaml/v3 is the root cause of this issue. While there was a breaking change from YAML 1.1 to 1.2 where yes/no and on/off are no longer considered booleans, go-yaml/v3 does support decoding to typed bool.
For compatibility reasons, it would be desirable for Docker Compose to accept yes/no and on/off as booleans when a boolean scalar is expected.
The text was updated successfully, but these errors were encountered:
yes as a boolean value is indeed a legacy yaml syntax which has been removed from the YAML spec with 1.2 release in 2009 (before docker compose existed), that's just sad compose was built with a 1.0/1.1 yaml parser and did not adopted this earlier
advanceboy
changed the title
[BUG] Error with 'read_only: yes' in Docker Compose v2.17.0
[BUG] Error "must be a boolean" with yes scalar in Docker Compose v2.17.0
Apr 13, 2023
@advanceboy no need to start a PR competition :)
we can just debate here. I agree with you having backward compatible support with warning, at least for a transition period, would be a nicer approach. I'll discuss this with the team
Description
I encountered an error with Docker Compose v2.17.0 when trying to load the following compose file:
The error message is below:
This issue did not occur in v2.16.
Steps To Reproduce
docker compose build
Compose Version
Docker:
Docker version 20.10.24, build 297e128
Compose:
Docker Compose version v2.17.2
@ Windows 10Docker Environment
No response
Anything else?
Like #10411, it seems that the update to go-yaml/v3 is the root cause of this issue. While there was a breaking change from YAML 1.1 to 1.2 where yes/no and on/off are no longer considered booleans, go-yaml/v3 does support decoding to typed bool.
For compatibility reasons, it would be desirable for Docker Compose to accept yes/no and on/off as booleans when a boolean scalar is expected.
The text was updated successfully, but these errors were encountered: