Open seantfish opened 1 year ago
i'd like to add to that: the use of !reset null
is met with the same error too.
[2023-08-16T11:43:41.501Z] YAMLException: unknown tag !<!reset> (3:23)
1 | services:
2 | backend:
3 | build: !reset null
---------------------------^
4 | image: mcr.microsoft.com/devcontainers/python:1-3. ...
5 | command: sleep infinity
at N6 (c:\Users\mail\.vscode\extensions\ms-vscode-remote.remote-containers-0.304.0\dist\extension\extension.js:243:947)
at ve (c:\Users\mail\.vscode\extensions\ms-vscode-remote.remote-containers-0.304.0\dist\extension\extension.js:243:982)
at Em (c:\Users\mail\.vscode\extensions\ms-vscode-remote.remote-containers-0.304.0\dist\extension\extension.js:250:5823)
at TEe (c:\Users\mail\.vscode\extensions\ms-vscode-remote.remote-containers-0.304.0\dist\extension\extension.js:250:2158)
at Em (c:\Users\mail\.vscode\extensions\ms-vscode-remote.remote-containers-0.304.0\dist\extension\extension.js:250:4897)
at TEe (c:\Users\mail\.vscode\extensions\ms-vscode-remote.remote-containers-0.304.0\dist\extension\extension.js:250:2158)
at Em (c:\Users\mail\.vscode\extensions\ms-vscode-remote.remote-containers-0.304.0\dist\extension\extension.js:250:4897)
at TEe (c:\Users\mail\.vscode\extensions\ms-vscode-remote.remote-containers-0.304.0\dist\extension\extension.js:250:2158)
at Em (c:\Users\mail\.vscode\extensions\ms-vscode-remote.remote-containers-0.304.0\dist\extension\extension.js:250:4897)
at AEe (c:\Users\mail\.vscode\extensions\ms-vscode-remote.remote-containers-0.304.0\dist\extension\extension.js:250:7289)
at L6 (c:\Users\mail\.vscode\extensions\ms-vscode-remote.remote-containers-0.304.0\dist\extension\extension.js:251:260)
at kEe (c:\Users\mail\.vscode\extensions\ms-vscode-remote.remote-containers-0.304.0\dist\extension\extension.js:251:474)
at kO (c:\Users\mail\.vscode\extensions\ms-vscode-remote.remote-containers-0.304.0\dist\extension\extension.js:271:2634)
at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
at async iK (c:\Users\mail\.vscode\extensions\ms-vscode-remote.remote-containers-0.304.0\dist\extension\extension.js:271:1921)
at async qC (c:\Users\mail\.vscode\extensions\ms-vscode-remote.remote-containers-0.304.0\dist\extension\extension.js:271:1858)
at async Pbe (c:\Users\mail\.vscode\extensions\ms-vscode-remote.remote-containers-0.304.0\dist\extension\extension.js:272:6047)
at async zO (c:\Users\mail\.vscode\extensions\ms-vscode-remote.remote-containers-0.304.0\dist\extension\extension.js:275:5396)
official compose documentation can be found here: https://docs.docker.com/compose/compose-file/13-merge/
at least i found a workaround. although this requires docker compose on the host:
the idea is to use docker compose -f docker-compose.yml -f docker-compose.devcontainer.yml config
to get the rendered compose config. then store that and configure devcontainer.json to use that rendered file.
i've modified my devcontainer.json to this:
{
"name": "dc/py3",
"initializeCommand": "docker compose -f ./docker-compose.yml -f .devcontainer/docker-compose.devcontainer.yml config > .docker-compose.rendered.yml",
// "dockerComposeFile": [ "../docker-compose.yml", "./docker-compose.devcontainer.yml" ],
"dockerComposeFile": "../.docker-compose.rendered.yml",
"service": "backend",
"workspaceFolder": "/workspace",
"shutdownAction": "stopCompose",
"runServices": [ "rabbitmq" ]
}
⚠️ the "initializeCommand" is executed inside the projects root. NOT inside of .devcontainer/
i've tested this on windows 11 with docker (and docker compose) installed inside a debian 11 WSL2.
the lifecycle hook "initializeCommand" is documented here: https://containers.dev/implementors/json_reference/#lifecycle-scripts
There appears to be a way to add custom tags to the js-yaml
module we are using for parsing: https://github.com/nodeca/js-yaml/blob/master/examples/handle_unknown_types.js
I am facing the same issue. @chrmarti can we please solve this issue?
Same goes for override
tag too. It is also not recognized.
VSCode Version: 1.80.1
Local OS Version: Windows 11
Remote Extension: Dev Containers (pre-release v0.302.0)
Logs:
Steps to Reproduce:
ports
and the extending file overriding that field withports: !reset []
Does this issue occur when you try this locally?: Yes Does this issue occur when you try this locally and all extensions are disabled?: No other extensions installed
!reset
is a recent addition in the compose specification, but Docker is updated and able to parse the !reset tag and start the container. The issue appears to occur when the extension tries to read the file.