I'm currently setting up a docker container group for development purposes using docker-compose.
I have a web container, a mysql container, and a phpmyadmin container. I'm using https://dockerfile.readthedocs.io/en/latest/content/DockerImages/dockerfiles/php-apache-dev.html as web container, the mariadb:10 image for the mysql container, and phpmyadmin/phpmyadmin:latest as phpmyadmin image.
The docker-compose.yml file looks like this:
version: '3'
services:
web:
container_name: web
restart: always
image: webdevops/php-apache-dev:7.4
user: application
environment:
- COMPOSER_VERSION=1
- WEB_ALIAS_DOMAIN=localhost
- WEB_DOCUMENT_ROOT=/app/pub
- PHP_DATE_TIMEZONE=EST
- PHP_DISPLAY_ERRORS=1
- PHP_MEMORY_LIMIT=2048M
- PHP_MAX_EXECUTION_TIME=300
- PHP_POST_MAX_SIZE=500M
- PHP_UPLOAD_MAX_FILESIZE=1024M
volumes:
- /projects/project-x:/app:cached
ports:
- '80:80'
- '443:443'
- '32823:22'
links:
- mysql
mysql:
container_name: mysql
restart: always
image: mariadb:10
ports:
- '3306:3306'
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=magento
volumes:
- db-data:/var/lib/mysql
phpmyadmin:
container_name: phpmyadmin
restart: always
image: phpmyadmin/phpmyadmin:latest
environment:
- MYSQL_ROOT_PASSWORD=root
- PMA_USER=root
- PMA_PASSWORD=root
ports:
- '8080:80'
links:
- mysql:db
depends_on:
- mysql
volumes:
db-data:
external: false
This works fine. However, my development project requires mariadb with version 10.2-10.4, nothing above. The standard mariadb:10 image currently provides 10.5.
When I change the line image: mariadb:10
to image: mariadb:10.4
, the container keeps restarting when I run docker-compose up -d --build
.
I checked on https://hub.docker.com/_/mariadb for pointers, but couldn't find a difference in setting up a container using 10.5 or 10.4 or 10.2 for that matter.
Any ideas?
Edits
I followed @xdhmoore's suggestion and changed restart to 'no'. This is the log I am getting from the container:
2021-02-22 20:34:56+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.4.17+maria~focal started.
2021-02-22 20:34:57+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2021-02-22 20:34:57+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.4.17+maria~focal started.
2021-02-22 20:34:57 0 [Note] mysqld (mysqld 10.4.17-MariaDB-1:10.4.17+maria~focal) starting as process 1 ...
2021-02-22 20:34:57 0 [Note] InnoDB: Using Linux native AIO
2021-02-22 20:34:57 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-02-22 20:34:57 0 [Note] InnoDB: Uses event mutexes
2021-02-22 20:34:57 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-02-22 20:34:57 0 [Note] InnoDB: Number of pools: 1
2021-02-22 20:34:57 0 [Note] InnoDB: Using SSE2 crc32 instructions
2021-02-22 20:34:57 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
2021-02-22 20:34:57 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
2021-02-22 20:34:57 0 [Note] InnoDB: Completed initialization of buffer pool
2021-02-22 20:34:57 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-02-22 20:34:57 0 [ERROR] InnoDB: Unsupported redo log format. The redo log was created with MariaDB 10.5.8.
2021-02-22 20:34:57 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2021-02-22 20:34:57 0 [Note] InnoDB: Starting shutdown...
2021-02-22 20:34:58 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-02-22 20:34:58 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-02-22 20:34:58 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-02-22 20:34:58 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2021-02-22 20:34:58 0 [ERROR] Aborting
I then googled for the first error that occurs and found this: MYSQL 8.0 - unsupported redo log format
It seems like I'd need to delete /var/lib/mysql/ to solve my issue. However, this is inside a docker container that I'm not able to start. Also, I rebuild this container upon every start, so I don't know how I can purge this directory?