devcontainers / devcontainers/features

Can't Bind Mount Host Folder Using docker-outside-of-docker

Open
#919 6 comments 1 reaction 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.