V
V
VicTHOR2021-02-08 13:22:09
Docker
VicTHOR, 2021-02-08 13:22:09

How to forward volume in WSL?

Installed docker desktop for windows with wsl 2
I want to create a folder in Windows using the composer

service

docker run -v $PWD:/app composer create-project ... project
, I don’t understand where it installs (it says /app/project). $PWD returns the current path in Windows in the \c\user\ style, I tried to specify .:/app - some kind of error, where instead of .:/app it shows .; c:/app.

How to transfer the current folder in Windows to docker then?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
akelsey, 2021-02-08
@akelsey

Let's say you are in the folder:
D:\Docker\MyFirstProject
and there are two objects in this folder:
DockerFile [file]
Data [folder]
Pass the relative path:

docker run -v ./data:/mnt/data composer create-project ... project

Inside the docker container, the /mnt/data directory will contain the contents of the d:\docker\myfirstproject\data\ folder from the host.
Those. everything inside this folder will be available inside the docker container.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question