bmvanity8723
bmvanity8723

Reputation: 21

Cannot run MariaDB within Docker

Whenever I try to run a MariaDB instance inside a Docker container, the startup fails with the error

docker-compose up --force-recreate
Recreating matomo-mariadb_1 ... done
Attaching to matomo-mariadb_1
matomo-mariadb_1  | /usr/local/bin/docker-entrypoint.sh: line 340: exec: –: not found

The docker-compose.yml in question:

version: '3'
services:
  mariadb:
    image: mariadb
    command:
      – max-allowed-packet=64MB
    restart: unless-stopped
    volumes:
        - /home/matomo/data/mysql:/var/lib/mysql

The directory "/home/matomo/data/mysql" has chmod -r 777 full access.

This seems to be an issue with the current Docker/Docker-Compose/MariaDB release because this happens on multiple devices with both Ubuntu 18 and Ubuntu 20.

Can anybody tell me how to fix this? Thanks!

Upvotes: 2

Views: 692

Answers (1)

Konrad Botor
Konrad Botor

Reputation: 5033

You specified the command in a wrong format.

It should be either:

command: max-allowed-packet=64MB

or

command: ["max-allowed-packet=64MB"]

See the Compose file reference.

Upvotes: 1

Related Questions