5
Docker 数据库即删即建 是我想得太美了吗?
source link: https://www.v2ex.com/t/865087
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
V2 大佬,请问 docker 搭建博客,nginx +php +mysql 三容器.各个都做了 volume 映射:其中 MySQL 如下
image: xxxx:$MYSQL_TAG
container_name: "${PROJECT_NAME}_mysql"
volumes:
- "./drupal/mysql:/var/lib/mysql"
restart: always
因为 Docker 是即删即建,我碰的问题是 docker-compose down 删除所有容器后 执行 docker-compose up -d , 为什么 MySQL 数据库容器没有读取./drupal/mysql 目录数据来恢复到删除前状态,还是要重新进 MySQL 容器执行导入数据库,谢谢解惑!
image: xxxx:$MYSQL_TAG
container_name: "${PROJECT_NAME}_mysql"
volumes:
- "./drupal/mysql:/var/lib/mysql"
restart: always
因为 Docker 是即删即建,我碰的问题是 docker-compose down 删除所有容器后 执行 docker-compose up -d , 为什么 MySQL 数据库容器没有读取./drupal/mysql 目录数据来恢复到删除前状态,还是要重新进 MySQL 容器执行导入数据库,谢谢解惑!
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK