Skip to content

Test: "initializeCommand" in devcontainer.json #2407

@chrmarti

Description

@chrmarti

Refs: #1045

Complexity: 3


On setting up DevContainers for testing: https://github.com/microsoft/vscode-remote-containers/blob/master/CONTRIBUTING.md#testing-remote-containers

"initializeCommand" in the devcontainer.json is an optional property that can be set to a string (run in a shell) or an array of strings (run without shell). Verify:

  • This always runs first when starting / connecting to a DevContainer.
  • Case 1: One of: Single-container (image or Dockerfile) or docker-compose.
  • Case 2: Repository container when the container does not exist yet or is rebuilt.
    • Check the command runs before the Docker image is built (note that there is an auxiliary image built first, the command runs only after that, but before the user image is built).
  • Case 3: Repository container when the container already exists.

The working directory of the command should be the workspace folder. Except with the repository container, the command runs locally on the host OS.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions