【发布时间】:2018-11-29 21:15:26
【问题描述】:
按照以下教程进行操作: https://docs.docker.com/compose/wordpress/
运行 docker-compose up 我得到:
Initializing database
[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
[ERROR] --initialize specified but the data directory has files in it. Aborting.
[ERROR] Aborting
已尝试按照此处的建议添加参数: https://github.com/docker-library/mysql/issues/186 https://github.com/docker-library/mysql/issues/69
但这似乎不起作用:
services:
db:
image: mysql:5.7
command: ["mysqld", "--ignore-db-dir=lost+found", "--explicit_defaults_for_timestamp"]
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
还有其他解决方案吗?
【问题讨论】:
-
认为我可能已经使用 'docker volume prune' 解决了它,但不确定......
-
请告诉我们你是怎么解决的,你
-
我的硬盘驱动器上的 Docker 容器空间不足。使用修剪命令修复它:docs.docker.com/config/pruning
标签: mysql wordpress docker docker-compose