window下,docker-compose启动mysql,invalid mount config for type "bind": source path must be a directory
我在window10下使用docker部署mysql5.7。先上docker-compose.ymlversion: '3'services:mysql:image: mysql:5.7restart: alwayscontainer_name: mysqlvolumes:- C:/do...
·
我在window10下使用docker部署mysql5.7。
先上docker-compose.yml
version: '3'
services:
mysql:
image: mysql:5.7
restart: always
container_name: mysql
volumes:
- C:/docker/mysql/conf/my.cnf:/etc/alternatives/my.cnf
- C:/docker/mysql/data:/var/lib/mysql
- C:/docker/mysql/logs:/var/log/mysql
environment:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
目录和配置文件都是存在的,然后使用docker-compose up -d 命令启动
命令行报错:
C:\docker>docker-compose up -d
Recreating 54cbd26d7449_mysql ... error
ERROR: for 54cbd26d7449_mysql Cannot create container for service mysql: invalid volume specification: 'C:\docker\mysql\conf\my.cnf:/etc/alternatives/my.cnf:rw': invalid mount config for type "bind": source path must be a directory
ERROR: for mysql Cannot create container for service mysql: invalid volume specification: 'C:\docker\mysql\conf\my.cnf:/etc/alternatives/my.cnf:rw': invalid mount config for type "bind": source path must be a directory
ERROR: Encountered errors while bringing up the project.
C:\docker>
更多推荐
已为社区贡献1条内容
所有评论(0)