Open GabrieleVolpato opened 2 years ago
I managed to get remote dev containers working by using the following override docker-compose.yml
:
version: '3'
services:
service-backend:
init: true
command: ["/bin/sh", "-c", "cp -R /workspaces/service/. /var/www/html && && php-fpm"]
volumes:
- code-volume:/var/www/html
service-webserver:
volumes:
- code-volume:/var/www/html
service-database:
volumes:
- db-volume:/var/lib/postgresql/data
volumes:
code-volume:
db-volume:
Basically I created another volume, mounted on both the backend and the webserver containers, where i copy the whole workspace into and I start developing from there. It's a workaround but it works in the meantime!
is there a solution fro this please ?
Try using "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}"
in the devcontainer.json and mount:
volumes:
- ../..:/workspaces:cached
in the dev container's service in the docker-compose.yml to get the same mount points as when cloning in a volume. If you need the workspace files available at another location in the dev container (like /var/www/html
), you could use a symlink. The volumes
for other services can be mounted as before (these are not overridden by the extension).
It still doesn't work. When I run one container with ../..:/workspaces
, another container with the same volume spec shows an error.
what is this volume mount in error logs : /run/user/1000/wayland-0
It still doesn't work. When I run one container with
../..:/workspaces
, another container with the same volume spec shows an error.
I see, you would want the other services to mount the same volume.
what is this volume mount in error logs :
/run/user/1000/wayland-0
We automatically mount the Wayland socket when WAYLAND_DISPLAY
is set locally (or in WSL under Windows).
We automatically mount the Wayland socket when
WAYLAND_DISPLAY
is set locally (or in WSL under Windows).
can this behavior be disabled? I'm getting an error about it (https://github.com/microsoft/vscode-remote-release/issues/9293) and I'm not sure why would I want wayland inside my dev container, I only very vaguelly know what it is.
Hello everyone, I'm working on a Symfony project which comes with a docker-compose file that looks like the following:
Since my development machine is a Windows machine and I'm using the WSL Docker backend, sharing files between Docker and the host machine is very slow. Developing inside my service container would completely solve the issue, but I'm finding quite a lot of problems sharing code between the service container and the webserver container.
My devcontainer.json:
My devcontainer docker-compose (used to override volumes mounts):
service-volume
is the name I chose for my volume when I runClone Repository in Named Container Volume
; as folder I used./
. When the extension tries to boot up the complete docker-compose file, it fails because of the/tmp/docker-compose.repositoryContainer.yml
file which is created automatically and tries to mount another volume. This is its content:I couldn't find any way to stop this last file creation. If I give a folder name different from
./
when I clone the repository, this file gets created anyway but changes the volume mount point to/workspaces
, even if I set/var/www/html
inside thedevcontainer.json
file.The solution would just to be able to define the
workspaceFolder
for multiple containers, and this should obviously work and not be ignored.Thanks in advance to anyone who will help me!