devcontainers / devcontainers/features
Can't Bind Mount Host Folder Using docker-outside-of-docker
- Dominant language
- Shell
- Stars
- 1.5k
- Forks
- 621
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 4
Description
Hi, I created a container from inside a dev container using the docker-outside-of-docker feature. I mapped an bind mount to the host repo folder. However, the files don't appear in the bound folder inside the container.
Minimum configuration to reproduce:
.devcontainer/devcontainer.json
```
{
"image": "mcr.microsoft.com/devcontainers/base:bullseye",
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
},
"remoteEnv": {
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
}
}
```
STEPS:
- Build and connect to the dev container.
- Run the command: `docker run -it --rm -v ${LOCAL_WORKSPACE_FOLDER}:/workspace debian bash`
BEHAVIOR:
- Can't see any files inside container folder /workspace
EXPECTED BEHAVIOR:
- See files from local workspace folder inside container at /workspace
ADDITIONAL INFO:
- Host: Windows 11 with Docker powered by WSL 2 with Ubuntu 22.
- Docker version: 25.0.3
Contributor guide
Assessment
This issue has not been assessed yet.