microsoft / microsoft/vscode-remote-release

DevContainers: cannot rebuild and reopen container ; devcontainer.json not found when file is located deeper than 1 subfolder (.devcontainer/myfolder1/myfolder2/devcontainer.json)

Open
#8,620 3 comments 12 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

containers feature-request
Dominant language
Dockerfile
Stars
4.2k
Forks
470
Avg merge
1d 1h
Merged PRs (30d)
1

Description

  • VSCode Version: 1.79.2 (2023-06-14)
  • Local OS Version: Ubuntu 22.04
  • Remote OS Version: Ubuntu 22.04
  • Remote Extension/Connection Type: Dev Containers
  • Logs: /

The following works:

Can open devcontainer with the following paths:

  • .devcontainer/devcontainer.json
  • .devcontainer/myfolder1/devcontainer.json

The following breaks:

Steps to Reproduce:

Cannot open devcontainer with the following path:

  • .devcontainer/myfolder1/myfolder2/devcontainer.json

Why does this need to work? (use case)

When working with multiple projects inside a repo you must split up everything by a clean folder structure.
First by project, then by development/production
Support for multiple devcontainers configs is a must! It works with 1 subfolder, why not multiple?

Examples:

  • .devcontainer/project_a/dev/devcontainer.json
  • .devcontainer/project_b/dev/devcontainer.json

There are also folders with "prod", no devcontainer.json files are there, only production containers:

Examples:

  • .devcontainer/project_a/prod/docker-compose.yaml
  • .devcontainer/project_a/prod/Dockerfile.ServiceA
  • .devcontainer/project_a/prod/Dockerfile.ServiceB
  • ...

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, using dev containers extension

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with .devcontainer/project_a/dev/devcontainer.json and compare it with the working one-level path .devcontainer/myfolder1/devcontainer.json. Trace how the Dev Containers extension discovers devcontainer.json files; done means nested configurations can be opened, rebuilt, and reopened successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose
Domain
developer-experience, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.