Volume binding using docker compose on Windows

一曲冷凌霜 提交于 2020-01-11 08:27:09

问题


I recently upgraded my Docker Toolbox on Windows 10, and now my volume mounts no longer work. I've tried everything. Here is the current mount path:

volumes:
  - C:\Users\Joey\Desktop\backend:/var/www/html

I receive an invalid bind mount error.


回答1:


I think you have to set COMPOSE_CONVERT_WINDOWS_PATHS=1, see here.

Docker Machine should do it automatically: https://github.com/docker/machine/pull/3830




回答2:


I faced with same issue (I'm using Docker Desktop).

My steps were:

1) Place your folder under drive "C"

2) Open "Settings" in Docker Desktop -> "Shared Drives" -> "Reset Credentials" -> select drive "C" -> "Apply"

3) Open terminal and run (as proposed by Docker Desktop):
docker run --rm -v c:/Users:/data alpine ls /data

4) Open your docker-compose.yml and update path in -volumes:

volumes:
  - /data/YOUR_USERNAME/projects/my_project/jssecacerts:/usr/lib/jvm/java-1.8-openjdk/jre/lib/security/jssecacerts/

5) restart docker container




回答3:


Is this is services section? You do now need it in the volume section, so if you had it just remove it.



来源:https://stackoverflow.com/questions/41334021/volume-binding-using-docker-compose-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!