-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] mapping key "<<" already defined in version >=2.17.0 #10407
Comments
Hiya @frederikhs, thanks for the report. Check #10394, particularly #10394 (comment):
You should address this by providing both anchors in the single merge key, such as: x-environment: &env
environment:
SOME_VARIABLE: "some_value"
x-deploy-limit: &deploy-limit
deploy:
resources:
limits:
memory: 24M
services:
service_a:
image: alpine
command: [ "sleep", "infinity"]
<<: [*env, *deploy-limit] |
## Summary Currently fails to deploy with the docker compose file on versions greater than v2.17, see [this](docker/compose#10407 (comment))
Current content.yaml format errors with docker-compose v2.17+. Running snapshot tests currently errors with: unmarshal errors: line 37: mapping key “<<” already defined at line 36 line 52: mapping key “<<” already defined at line 51 line 83: mapping key “<<” already defined at line 82 This CR fixes that error. Context: docker/compose#10407 (comment) Change-Id: I15d9e1d7bb799819a783904cf9dc0bb5a26efcae Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/496189 Run-TryBot: Jamal Carvalho <jamal@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Fix a bunch of `mapping key "<<" already defined in version` errors when building images using docker compose v2.17+. See: - docker/compose#10407 - docker/compose#10394 (comment)
Description
Upon upgrading from Docker Compose version 2.16.0 to Docker Compose version 2.17.2 it seems like 2.17 and above dropped support for merging in yaml, ref: https://yaml.org/type/merge.html
I seems to happen when to merge keys
<<
exists in the same service. If only 1 exist there is not error.I see nowhere this is mentioned. I will therefore make this issue a bug since it is.
Steps To Reproduce
Using the follow docker compose file:
Running:
Results in:
yaml: unmarshal errors: line 16: mapping key "<<" already defined at line 15
Compose Version
Docker Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: