Tek
Tek

Reputation: 3070

Can I mount data to host filesystem from docker's VOLUME CREATE?

It's great that I can make a volume to share between applications.

docker volume create --name hello

However, if I wanted to use my host's IDE to edit this data how could I?

Upvotes: 3

Views: 138

Answers (1)

VonC
VonC

Reputation: 1329092

For now, you would need to mount a host directory (as a data volume) in order to be able to edit a file from the host directly in a container.

-v /src/webapp:/opt/webapp training/webapp python app.py

This command mounts the host directory, /src/webapp, into the container at /opt/webapp. If the path /opt/webapp already exists inside the container’s image, the /src/webapp mount overlays but does not remove the pre-existing content.

Upvotes: 1

Related Questions