0
我試圖使用泊塢窗,撰寫,使用下面的配置文件創建一個MySQL泊塢窗容器..泊塢窗10託管量 - 不創建文件
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文件夾中創建的。之後,我進入'D;/ian/data/swot'窗口文件夾並刪除了由MySQL創建的所有文件。
此後,當我重新運行docker-compose進程時,它不會在主機文件夾中創建MySQL文件。
任何想法?