How to share the volume created by ‘Dev Containers: Clone Repository in Container Volume…’

  Kiến thức lập trình

I’m building a devcontainer setup for a webapp which uses docker-compose to fire up multiple services. I’d like to be able to add a service (webpack) to support hot-reloading to my docker-compose.yml but in order to do that, it needs to mount the same volume that the repo is cloned to. Is there any way to have the docker-compose configuration for my hot-reload service to find and mount the volume VSCode created when it cloned the repo into it?

I’ve tried cloning into a named volume and hard-coding that volume name in the docker-compose.yml which starts the hot-reloading service which works, but is sub-optimal as every developer using the devcontainer setup would also need to ensure they used the same name when initially launching the devcontainer

New contributor

Shaun Lowry is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT