Docker Windows 10托pipe的卷 – 不创build文件

我正在尝试使用docker-compose创build一个MySQL docker容器,使用下面的configuration文件。

version: '2' services: # Name of the service as Docker will reference. mysqlDb: # The image, change 5.7 to any of the supported docker versions. image: mysql:latest # Required environment variables. Creates a Database with a # root user, non-root user both with passwords. # # MYSQL_ROOT_PASSWORD defines the root password of the root user # MYSQL_DATABASE names the DB # MYSQL_USER is the non-root user # MYSQL_PASSWORD is the non-root user password environment: MYSQL_ROOT_PASSWORD: "pascal01" MYSQL_DATABASE: "swot" # What port do you want this MySQL instance to be available on? # The left hand number is what port it will be available on from your machine # perspective. The right hand number is the post that it's linking up to. # In this case we're saying "link our local 3306 to the docker container's 3306" # which works here, because docker MySQL exposes the MySQL DB to the container's # 3306 port. If we wanted this available on port 3307 on our local machine # we'd change this to 3307:3306 ports: - 3306:3306 # We're using a named volume here that docker manages for us. This is a special # place just for this particular dockerized MySQL instance. volumes: - d:/ian/data/swot:/var/lib/mysql 

当我第一次跑这个时,一切都很好。 一堆文件是在Windows 10文件夹中创build的。 之后,我进入了“D / ian / data / swot”窗口文件夹,并删除了由MySQL创build的所有文件。

此后,当我重新运行docker-compose进程时,它不会在主机文件夹中创buildMySQL文件。

有任何想法吗?

发现问题。 诺顿档案墙阻止访问。 但docker容器输出到命令行没有任何东西可以表明这一点。