docker-compose.yml
version: '3'
services:
mysql56:
image: mysql:5.6
container_name: mysql56
volumes:
- ./mysql/data/mysql:/var/lib/mysql
- ./mysql/conf:/etc/mysql
ports:
- 3307:3306
- 33060:33060
environment:
TZ: Asia/Shanghai
MYSQL_ROOT_PASSWORD: 'root@123'
networks:
- shanhy-ci
networks:
shanhy-ci:
driver: bridge
运行
docker-compose up -d
# Creating mysql56 ... done
docker exec -i -t $(docker ps -q) bash
cd /var/lib/mysql
ls
没有任何目录和文件,
本地的 ./mysql/data/mysql 目录也是空白的,
但是我可以连接的上这个mysql容器,里面自带的表也是正常的
环境:
windows10
docker
请问这是为什么呢?
猜测是不是跟它有关: https://segmentfault.com/q/10...