How to use --volume option with Docker Toolbox on Windows?

后端 未结 9 2341
北荒
北荒 2020-12-12 17:19

How can I share a folder between my Windows files and a docker container, by mounting a volume with simple --volume command using Docker Toolbox on?

I\'

9条回答
  •  眼角桃花
    2020-12-12 17:35

    This is actually an issue of the project and there are 2 working workarounds:

    1. Creating a data volume:

      docker create -v //c/Users/myuser:/myuser --name data hello-world
      winpty docker run -it --rm --volumes-from data ubuntu
      
    2. SSHing directly in the docker host:

      docker-machine ssh default
      

      And from there doing a classic:

      docker run -it --rm --volume /c/Users/myuser:/myuser ubuntu
      

提交回复
热议问题