Currently, you cannot use the new Open in Dev Containers badge because the docker-compose.yml file tries to mount the current directory, which is not compatible with cloning the repo into a (named) Docker volume first.
To support both use cases (mounting the repo from a local directory, and mounting the repo from a Docker volume), we first expose Dev Container's localWorkspaceFolder variable to Docker Compose, and then mount that dynamically [1].
Currently, you cannot use the new Open in Dev Containers badge because the
docker-compose.yml
file tries to mount the current directory, which is not compatible with cloning the repo into a (named) Docker volume first.To support both use cases (mounting the repo from a local directory, and mounting the repo from a Docker volume), we first expose Dev Container's
localWorkspaceFolder
variable to Docker Compose, and then mount that dynamically [1].[1] https://stackoverflow.com/questions/60778464/vscode-devcontainer-json-mounts-not-working