Docker Windows11 MariaDB

Hi,
I was using a Macbook pro with this docker-compose.yml, and everything was working well:

version: '2'
services:
  wordpress:
    env_file:
      .env
    depends_on:
      - db
    image: wordpress
    restart: always
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: $WORDPRESS_DB_USER
      WORDPRESS_DB_PASSWORD: $WORDPRESS_DB_PASSWORD
      WORDPRESS_DB_NAME: $MYSQL_DATABASE
    ports:
      - 8888:80
    networks:
      - myNetwork
    volumes:
      - ./:/var/www/html
  db:
    env_file:
      .env
    image: mariadb
    restart: always
    volumes:
      - ./.database:/var/lib/mysql    
    environment:
      MYSQL_ROOT_PASSWORD: $MYSQL_ROOT_PASSWORD
      MYSQL_DATABASE: $MYSQL_DATABASE
      MYSQL_USER: $MYSQL_USER
      MYSQL_PASSWORD: $MYSQL_PASSWORD
    networks:
      myNetwork:
        ipv4_address: 171.29.0.2
  phpmyadmin:
    env_file:
      .env
    depends_on:
      - db
    image: phpmyadmin
    restart: always
    ports:
      - 8080:80
    environment:
      PMA_HOST: db
      MYSQL_ROOT_PASSWORD: $MYSQL_ROOT_PASSWORD
    networks:
      - myNetwork
  compass:
    image: dedavidson/compass-watch
    command: watch --poll /src/compass
    volumes:
      - ./:/src
networks:
  myNetwork:
    driver: bridge
    ipam:
     config:
       - subnet: 171.29.0.0/16
         gateway: 171.29.0.1
volumes:
  database:

Once I’m trying to docker-compose up on my Windows11, I got the following error:

tm2022-db-1          | 2023-10-25 12:00:52+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
tm2022-db-1          | 2023-10-25 12:00:52+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.1.2+maria~ubu2204 started.
tm2022-db-1          | 2023-10-25 12:00:52+00:00 [Note] [Entrypoint]: MariaDB upgrade information missing, assuming required
tm2022-db-1          | 2023-10-25 12:00:52+00:00 [Note] [Entrypoint]: MariaDB upgrade (mariadb-upgrade) required, but skipped due to $MARIADB_AUTO_UPGRADE setting
tm2022-db-1          | 2023-10-25 12:00:53 0 [Warning] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
tm2022-db-1          | 2023-10-25 12:00:53 0 [Note] Starting MariaDB 11.1.2-MariaDB-1:11.1.2+maria~ubu2204 source revision 9bc25d98209df6810f7a7d5e7dd3ae677a313ab5 as process 1
tm2022-db-1          | 2023-10-25 12:00:53 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
tm2022-db-1          | 2023-10-25 12:00:53 0 [Note] InnoDB: Number of transaction pools: 1
tm2022-db-1          | 2023-10-25 12:00:53 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
tm2022-db-1          | 2023-10-25 12:00:53 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
tm2022-db-1          | 2023-10-25 12:00:53 0 [Note] InnoDB: Using liburing
tm2022-db-1          | 2023-10-25 12:00:53 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
tm2022-db-1          | 2023-10-25 12:00:53 0 [Note] InnoDB: Completed initialization of buffer pool
tm2022-db-1          | 2023-10-25 12:00:53 0 [Note] InnoDB: Buffered log writes (block size=512 bytes)
tm2022-db-1          | 2023-10-25 12:00:53 0 [Note] InnoDB: End of log at LSN=47497
tm2022-db-1          | 2023-10-25 12:00:53 0 [ERROR] InnoDB: Space id and page no stored in the page, read in are [page id: space=4, page number=2], should be [page id: space=0, page number=3]
tm2022-db-1          | 2023-10-25 12:00:53 0 [ERROR] InnoDB: The change buffer is corrupted
tm2022-db-1          | 2023-10-25 12:00:53 0 [ERROR] InnoDB: Plugin initialization aborted with error Page read from tablespace is corrupted.
tm2022-db-1          | 2023-10-25 12:00:53 0 [Note] InnoDB: Starting shutdown...
tm2022-db-1          | 2023-10-25 12:00:53 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
tm2022-db-1          | 2023-10-25 12:00:53 0 [Note] Plugin 'FEEDBACK' is disabled.
tm2022-db-1          | 2023-10-25 12:00:53 0 [Note] Plugin 'wsrep-provider' is disabled.
tm2022-db-1          | 2023-10-25 12:00:53 0 [ERROR] Unknown/unsupported storage engine: InnoDB
tm2022-db-1          | 2023-10-25 12:00:53 0 [ERROR] Aborting

any idea?

thanks a lot!

Don’t store the MySQL folder on a Windows filesystem. It worked on macOS because that is Unix compatible with Linux. Create a volume instead of bind mounting mysql data.

It seems you tried to do that, because there is a volume definition, but the service definition doesn’t use it.

USe this way:

volumes:
  - database:/var/lib/mysql

Or Enable WSL 2 integration and run the docker command in a WSL distributuon so you can store mysql data on a Linux filesystem.

I know the quoted message was just a waning, but it is likely that it somehow causes the issue.