V
V
Vladyslav2021-01-27 20:43:01
Docker
Vladyslav, 2021-01-27 20:43:01

Docker how to transfer files from pc to docker via -v?

Hello everyone, there is always some problem with transferring files from PC to Docker via -v

docker run --name mongo -v /internalDB:/data/db -d mongo

That is, I transfer from the main folder to the internal folder -- In the data / db folder, all files from the internal folder, no? If so, why don't they move to the ducker?

6011a57b2dce6072588096.png
6011a581efd7e843836400.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
ayazer, 2021-01-27
@Avgona

-v just mounts the folder (rather than copying the data) from the host to docker. judging by what I see, such a folder exists in the docker, so you can’t mount it,
you can do /internalDB:/data/internalDB and then just copy it to where you need

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question