Accessing Docker container files from Windows

后端 未结 2 1019
刺人心
刺人心 2021-02-06 23:37

How can I access Docker containers Folder and files from Windows file explorer?

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-07 00:11

    You should use a mount volume. In your docker run .... command, you may specify a mount volume. The syntax is as follows:

    -v /host/directory:/container/directory

    An example:

    docker run -it -v C:\Users\thomas\Desktop:/root/home --name my_container image1

    This would allow the container to write files to /root/home and have them appear on the user thomas' desktop

提交回复
热议问题