Running a container on Linux:
$ docker run -it --name damastes --rm --mount type=bind,source="$HOME"/,target=/enjoy --mount type=bind,source=/run/media,target=/run/media,bind-propagation=shared -w /enjoy damastes:latest
docker-compose.yml
:
services:
damastes:
image: damastes:latest
volumes:
- type: bind
source: $HOME
target: /enjoy
- type: bind
source: /run/media
target: /run/media
bind:
propagation: shared
working_dir: /enjoy
Can't even start to guess how the second mount should look on Windows.
Copyright Notice:Content Author:「Alexey Orlov」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/70622370/docker-container-mount-plugged-devices-on-windows