我正在使用 Docker for Mac 1.12.1 并且有一个启动 WordPress 和 MySQL 服务的 Docker Compose 文件
编写文件
version: '2'
services:
db:
container_name: mysql_db
image: mysql:5.7
volumes:
- "./.data/db:/var/lib/mysql"
restart: always
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
container_name: wordpress
depends_on:
- db
image: wordpress:latest
links:
- db
ports:
- "8000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_PASSWORD: wordpress
volumes:
- wordpress/:/var/www/html/
volumes:
wordpress:
但是,在成功启动所有内容后,我找不到命名卷在我的 Mac 上的位置。
MacBookAir:wordpress carlwainwright$ docker volume inspect wordpress_wordpress
[
{
"Name": "wordpress_wordpress",
"Driver": "local",
"Mountpoint": "/var/lib/docker/volumes/wordpress_wordpress/_data",
"Labels": null,
"Scope": "local"
}
]
MacBookAir:wordpress carlwainwright$ ls -l /var/lib/docker/volumes/wordpress_wordpress/_data/
ls: /var/lib/docker/volumes/wordpress_wordpress/_data/: No such file or directory
有任何想法吗?