Multiple services in docker-compose with separate devcontainer.json files - only one service gets features installed
@v-Kaniska244 ya está trabajando en esto.
Desde el 27/4/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Bug Report
Description
When using a single docker-compose.yml file with multiple services, each having their own separate .devcontainer/devcontainer.json files, only one service gets its features installed. The service that is started first gets its features correctly installed, while the second service is missing its configured features.
Additionally, using devcontainer up on one service causes the other service's container to be rebuilt, even though they should be independent.
Root Cause
The devcontainer CLI generates a single temporary containerFeatures override file for the entire docker-compose project, instead of generating per-service override files. This temporary file only contains the configuration for the service that was most recently processed, causing the other service's features to be ignored.
Evidence
1. Both containers reference the same temporary file
Container labels show both containers pointing to the identical temporary override file:
com.docker.compose.project.config_files: /var/folders/.../docker-compose.devcontainer.containerFeatures-1777044430151-115a3236-0fb3-4ab5-bdb6-d1baa4463613.yml
2. Temporary file only contains one service's configuration
The temporary override file (docker-compose.devcontainer.containerFeatures-*.yml) only contains configuration for the reportify service:
services:
'reportify':
entrypoint: ["/bin/sh", "-c", "echo Container started\n..."]
labels:
- 'devcontainer.local_folder=/Users/shihaonan/.devcontainer/xiaobangtouzi/reportify'
- 'devcontainer.config_file=/Users/shihaonan/.devcontainer/xiaobangtouzi/reportify/.devcontainer/devcontainer.json'
The duplik service configuration is completely missing from this file.
3. Container metadata confirms missing features
When inspecting the containers:
- reportify container:
devcontainer.metadatalabel includes Python feature - duplik container:
devcontainer.metadatalabel is missing the Python feature
When executing commands inside containers:
- reportify container: Has Python 3.11.15 installed ✓
- duplik container: No Python installed ✗
Configuration
docker-compose.yml (shared by both services)
services:
duplik:
build:
context: ./duplik
dockerfile: Dockerfile
volumes:
- src:/workspaces
command: sleep infinity
reportify:
build:
context: ./reportify
dockerfile: Dockerfile
volumes:
- src:/workspaces
command: sleep infinity
volumes:
src:
duplik/.devcontainer/devcontainer.json
{
"name": "Duplik Development",
"dockerComposeFile": "../../docker-compose.yml",
"service": "duplik",
"workspaceFolder": "/workspaces/duplik",
"features": {
"ghcr.io/devcontainers/features/python:1": {
"version": "3.10"
}
},
"onCreateCommand": "/root/.devcontainer/init.sh",
"postStartCommand": "cd ~/.config/nvim && git pull --rebase",
"overrideCommand": false,
"runServices": [],
"remoteUser": "root"
}
reportify/.devcontainer/devcontainer.json
{
"name": "Reportify Development",
"dockerComposeFile": "../../docker-compose.yml",
"service": "reportify",
"workspaceFolder": "/workspaces/reportify",
"features": {
"ghcr.io/devcontainers/features/python:1": {
"version": "3.11"
},
"ghcr.io/devcontainers-extra/features/poetry:2": {}
},
"onCreateCommand": "/root/.devcontainer/init.sh",
"postStartCommand": "cd ~/.config/nvim && git pull --rebase",
"overrideCommand": false,
"runServices": [],
"remoteUser": "root"
}
Expected Behavior
According to VS Code Dev Containers documentation, it is officially supported to have:
- A single
docker-compose.ymlfile - Multiple services
- Each service with its own separate
.devcontainer/devcontainer.jsonfile
Expected: Each service should have its own features installed independently, and starting one service should not cause the other to rebuild.
Actual Behavior
- Only one service gets its features installed (the one that was processed first/last by the CLI)
- The other service is missing all configured features
- Using
devcontainer upon one service causes the other service's container to be rebuilt
Environment
- OS: macOS (Darwin 25.4.0)
- Docker Desktop latest
- Lenguaje dominante
- TypeScript
- Estrellas
- 3k
- Forks
- 461
- Merge medio
- 13 h 17 min
- PR fusionados (30 d)
- 6
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de devcontainers/cli
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
devcontainers/cli#1203 ·
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 68/100
devcontainers/cli#1178 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
devcontainers/cli#1301 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 74/100
devcontainers/cli#1300 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
devcontainers/cli#1298 ·
Todos los issues de devcontainers/cli
Issues similares
-
Browser Waiting for: Product Owner
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
getsentry/sentry-javascript#24577 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
agilepathway/label-checker#640 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
copse-dev/agent-pane#2953 ·
-
[aw] Upgrade available Abiertoagentic-workflows
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
githubnext/rig#534 ·
-
automation missing-model model-sync provider:pioneer
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
anomalyco/models.dev#7701 ·