0
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によって作成されたすべてのファイルを削除しました。
その後、ドッカー作成プロセスを再実行すると、ホストフォルダにMySQLファイルが作成されません。
アイデア?