Portal:Container/Image/mariadb

Jump to: navigation, search

openSUSE MariaDB Container Image

Description

This container image contains the latest mariadb database daemon from openSUSE Tumbleweed.

Location

  • registry.opensuse.org/opensuse/mariadb

Configuration

This container image requires a local data directory or volume, by default /srv/mariadb, mounted in the container as /var/lib/mysql. During the first start a new database will be created if none exists already.

Supported environment variables:

  • MARIADB_ROOT_PASSWORD - needs to contain the root password for the database
  • MARIADB_ALLOW_EMPTY_ROOT_PASSWORD - Allow empty root password
  • MARIADB_RANDOM_ROOT_PASSWORD - Set a generated random password is generated and will appear in the container logs
  • MARIADB_INITDB_SKIP_TZINFO - when non-empty - skips the initialization of timezone data
  • MARIADB_ROOT_HOST - The remote root user is created as `root@$MARIADB_ROOT_HOST`
  • MARIADB_DATABASE - This database is created
  • MARIADB_USER - This user is created, with full grants on the `$MARIADB_DATABASE`
  • MARIADB_PASSWORD - The user is created with this password
  • MARIADB_AUTO_UPGRADE - when set, perform a mariadb-upgrade

For more information see MariaDB Environment Variables.

Run

 # podman run -d --rm -v /srv/mariadb:/var/lib/mysql --name mariadb --env MARIADB_ROOT_PASSWORD=pass --env MARIADB_USER=user --env MARIADB_PASSWORD=pass --env MARIADB_DATABASE=db --env MARIADB_AUTO_UPGRADE=1 -p 3306:3306 registry.opensuse.org/opensuse/mariadb

Systemd support

The package containers-systemd contains a service file and sysconfig file to configure and automatically start the mariadb container with systemd.

 # systemctl start container-mariadb