Hey there!
I’m very, very new to Docker and am using the Docker setups provided by my company. Unfortunately developing on Windows is quite slow with Docker for me. I’ve read a lot about the problem being the copying of my source code to WSL and then to the Container is what takes so much time, but I don’t understand how to go from here.
Should I put my source code into WSL? How would I do that?
Or does it have to do something with with best practice from the Docker Desktop WSL 2 backend documentation:
- Performance is much higher when files are bind-mounted from the Linux filesystem, rather than remoted from the Windows host. Therefore avoid
docker run -v /mnt/c/users:/users
(where/mnt/c
is mounted from Windows).- Instead, from a Linux shell use a command like
docker run -v ~/my-project:/sources <my-image>
where~
is expanded by the Linux shell to$HOME
.
I do have a docker-compose file, containing several services, one of which has the following volumes defined:
volumes:
- ${APP_PATH_HOST:-./}:/var/www/shophelper
- ./docker/nginx:/etc/nginx/conf.d/
- ./storage/logs/nginx:/var/log/nginx
- ./localhost.crt:/etc/ssl/certs/localhost.crt
- ./localhost.key:/etc/ssl/private/localhost.key
As far as I understand the “${APP_PATH_HOST:-./}” part before “/var/www/shophelper” is the full length path to the project dir in my Windows host file system and this is what should be changed to “~/my-project” from the documentation. However if I just write it like this: “~/shop-helper:/var/www/shophelper” with “shop-helper” being the name of the project dir, it doesn’t work.
Does anybody know what I’m doing wrong? Unfortunately I don’t even know what to google anymore, I feel kind of lost
Thank you for reading. Any help would be greatly appreciated