Devcontainer `initializeCommand` erroneously runs on container reopen
@chrmarti is already working on this.
Since Sep 6, 2023.
Assessment
This issue has not been assessed yet.
Description
Looking at the devcontainer spec, the initializeCommand is supposed to run when the dev container is created:
A command string or list of command arguments to run on the host machine before the container is created.
However, in practice it seems like the command is also being run when the devcontainer is reopened. This reduces the value of the initializeCommand as a place to do pre-container-creation cleanup and doesn't adhere to the spec.
Here's a link to a video demoing the problem.
Reproduction steps
- Clone this repo
- Open the folder in VS Code
- Open the folder in a dev container. (Command Palette >
Dev Containers: Reopen in Container). (As expected, you should see the logs from the initialize command being run.) - Close the dev container (Command Palette >
Dev Containers: Reopen Folder Locally). - Reopen the dev container (Command Palette >
Dev Containers: Reopen in Container).
Expected
Because the container is only being reopened and not created, the initializeCommand should not run and the corresponding logs shouldn't print.
Actual
The initializeCommand is run and the logs are printed.
Help would be much appreciated!
- Dominant language
- Dockerfile
- Stars
- 4.2k
- Forks
- 470
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode-remote-release
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
microsoft/vscode-remote-release#11650 ·
-
ssh
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
microsoft/vscode-remote-release#11583 ·
-
ssh
Difficulty 4/5 3-5 days Newbie friendliness 38/100
microsoft/vscode-remote-release#11861 ·
-
microsoft/vscode-remote-release#11860 · 1 comment · 1 assignee ·
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
microsoft/vscode-remote-release#11859 ·