我为我的Laravel设置了一个本地Docker环境(MAC)。
image: mariadb:10.6
container_name: ct-mariadb
restart: unless-stopped
ports:
- "3306:3306"
volumes:
- ./docker/storage/mysql:/var/lib/mysql
environment:
MYSQL_DATABASE: ....
MYSQL_USER: ....
MYSQL_PASSWORD: ....
MYSQL_ROOT_PASSWORD: ....
SERVICE_TAGS: dev
SERVICE_NAME: mysql
networks:
- laravel
设置通常工作正常,但在测试一些手动DB更改后,它被损坏。当通过docker-compose up -d --build
(重新)启动容器时,mariadb容器无法启动。在容器日志中可以找到以下内容:
2022-05-05 23:13:17+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.7+maria~focal started.
2022-05-05 23:13:18+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-05-05 23:13:18+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.7+maria~focal started.
2022-05-05 23:13:18+00:00 [Note] [Entrypoint]: MariaDB upgrade not required
2022-05-05 23:13:19+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.7+maria~focal started.
2022-05-05 23:13:19+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-05-05 23:13:19+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.7+maria~focal started.
2022-05-05 23:13:19+00:00 [Note] [Entrypoint]: MariaDB upgrade not required
2022-05-05 23:13:20+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.7+maria~focal started.
2022-05-05 23:13:20+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-05-05 23:13:20+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.7+maria~focal started.
2022-05-05 23:13:21+00:00 [Note] [Entrypoint]: MariaDB upgrade not required
2022-05-05 23:13:18 0 [Note] mariadbd (server 10.6.7-MariaDB-1:10.6.7+maria~focal) starting as process 1 ...
2022-05-05 23:13:18 0 [Warning] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2022-05-05 23:13:18 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-05-05 23:13:18 0 [Note] InnoDB: Number of pools: 1
2022-05-05 23:13:18 0 [Note] InnoDB: Using ARMv8 crc32 + pmull instructions
2022-05-05 23:13:18 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
2022-05-05 23:13:18 0 [Note] InnoDB: Using Linux native AIO
2022-05-05 23:13:18 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2022-05-05 23:13:18 0 [Note] InnoDB: Completed initialization of buffer pool
2022-05-05 23:13:18 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=507568654,515471506
2022-05-05 23:13:18 0 [ERROR] InnoDB: Missing FILE_CREATE, FILE_DELETE or FILE_MODIFY before FILE_CHECKPOINT for tablespace 230
2022-05-05 23:13:18 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
2022-05-05 23:13:18 0 [Note] InnoDB: Starting shutdown...
2022-05-05 23:13:19 0 [ERROR] Plugin 'InnoDB' init function returned error.
2022-05-05 23:13:19 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2022-05-05 23:13:19 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-05-05 23:13:19 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2022-05-05 23:13:19 0 [ERROR] Aborting
我已经尝试删除所有的容器,图像和卷几次通过Docker桌面用户界面和docker rm -f $(docker ps -a -q) docker rmi -f $(docker images -q)
,但启动容器后,我得到完全相同的错误再次。
我不明白为什么/如何在完全删除所有容器,映像和卷后,这个错误仍然会回来。
任何帮助都是非常感谢的。
1条答案
按热度按时间brvekthn1#
对于可能会有所帮助的人.....
虽然我清理了docker容器,图像和卷与以下命令。
我的mariadb定义引用了位于./docker/storage/mysql中的本地卷
在清理了我的项目Docker〉〉存储文件夹(基本上得到了我的项目的一个新的拉力。我可以再次启动Docker没有上述错误。