Hello everyone,
After a while, I am trying to develop some integrations for Home Assistant.
I was used to working in a devcontainer with Home Assistant core. To create the container, I followed this guide: Set up Development Environment | Home Assistant Developer Docs
However, after synchronizing my local fork to the latest commit, it did not start anymore.
I noticed that the support for Python 3.9 was dropped, so I decided to restart everything from scratch.
I followed again the guide linked before (Set up Development Environment | Home Assistant Developer Docs ), but I was not able to recreate the devcontainer.
Specifically, I get the following error during creation time:
[2023-02-02T10:25:18.681Z] Error: ENOENT: no such file or directory, lstat '/root/.vscode-remote-containers/dist/dev-containers-cli-0.266.1/dist/node_modules/vscode-dev-containers/container-features'
I put the last lines of the log (if they could be useful to understand the issue better).
Log
I tried to search on Google, but I did not find any issue like this. Do you have any idea of how to solve this issue?
Additional details about my current configuration:
Configuration
OS: Windows 10 Pro 22H2
Docker Desktop: version 4.16.3 (96739)
Visual Studio Code: version 1.74.3
Dev Containers extension: version 0.266.1
I hope that someone can help me; thank you very much for your time and support!
I found an issue on GitHub that seems similar to my problem:
opened 12:02PM - 10 Oct 22 UTC
bug
containers
The latest version of remote containers no longer allows me to build a container… that is externally defined in a dockerfile. The issue is fixed by going back to the previous version of the plugin.
- VSCode Version:1.72.0
- Local OS Version: Windows 11 21H2
- Remote OS Version: Ubuntu 20.04 (WSL2)
- Remote Extension/Connection Type: Container running in Docker desktop
- Logs: [error.log](https://github.com/microsoft/vscode-remote-release/files/9745751/error.log)
Steps to Reproduce:
1. Create new directory and drop the .devcontainer.json file in the root
```
{
"name": "Tensorflow with Jupyter (GPU enabled)",
"build": { "dockerfile": "docker/Dockerfile" },
"forwardPorts": [8888],
"postStartCommand": "nohup bash -c 'jupyter notebook --ip=0.0.0.0 --port=8888 --allow-root --NotebookApp.token=jupdevtoken &'",
"runArgs": [
"--gpus",
"all"
],
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter"
]
}
```
2. Create a docker subdirectory, drop Dockerfile in that subdir
```
FROM tensorflow/tensorflow:latest-gpu-jupyter
RUN pip install pandas\
sklearn\
seaborn\
```
3. Start VS Code and restart the directory in the container
4. The following error occurs when building the container (full log in `error.log`
```
error: failed to solve: rpc error: code = Unknown desc = failed to solve with fr
ontend dockerfile.v0: failed to solve with frontend gateway.v0: rpc error: code
= Unknown desc = target stage dev_containers_target_stage could not be found
```
Does this issue occur when you try this locally?: Yes
Does this issue occur when you try this locally and all extensions are disabled?: Yes
Therefore, I downgraded the “Dev Containers” Visual Studio Code extension from v0.266.1 to v0.262.3 .
The previous error is not displayed anymore!
I rebuilt a new Home Assistant’s core devcontainer, and it seems it is finally working!
I hope that this answer could be helpful to other people in my situation!