SLE MariaDB Server

MariaDB Server container based on the SLE Base Container Image.

Get Image

MariaDB Server Container Image


MariaDB is an open-source, multi-threaded, relational database management system. It's a backward-compatible branch of the MySQL Community Server that provides a drop-in replacement for MySQL.


By default, the image launches MariaDB with the same configuration that comes with SUSE Linux Enterprise Server, with two exceptions: logging is sent to stdout, and binding to localhost is disabled.

The only environment variable required to start the container is the MariaDB root password.

$ podman run -it --rm -p 3306:3306 -e MARIADB_ROOT_PASSWORD=my-password


$ podman run -it --rm -p 3306:3306 -e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1


The database is stored in the directory /var/lib/mysql.

When using the MariaDB image, we recommend one of the following options:

  • Use a named volume to manage the storage of your database data. This is the default option and it is easy to use. The downside is that the files may be hard to locate for tools and applications that run directly on the host system, i.e. outside containers.
  • Create a data directory on the host system (outside the container) and mount the created directory to a directory accessible from inside the container. This stores the database files in a known location on the host system and makes it easy for tools and applications on the host system to access the files. If you choose this approach, make sure that the specified directory exists, and its permissions along with other security mechanisms on the host system are set up correctly.

To mount a host directory as a volume for your data run the following command:

$ podman run -it --rm -v /my/own/datadir:/var/lib/mysql:Z -p 3306:3306 -e MARIADB_ROOT_PASSWORD=my-password

The -v /my/own/datadir:/var/lib/mysql:Z part of the command mounts the /my/own/datadir directory from the underlying host system as /var/lib/mysql inside the container, where MariaDB will by default write its data files.

Environment variables


All other environment variables are optional.

All environment variables are documented in the MariaDB's Knowledge Base MariaDB Server Docker Official Image Environment Variables.

Health, liveness and readiness

There are no explicit health checks added to the container image. However, you can use the script to choose from a limited selection of tests to check for what you consider health, liveness, and readiness.

If there is no database initialized when the container starts, a default database is created. This means that incoming connections are not accepted until the initialization is completed. Use the script to check for container readiness.

To learn about, how to use it, and what tests are provided, refer to the MariaDB's Knowledge Base Using

Usage against an existing database

If you start a MariaDB container instance with a data directory that already contains a database (specifically, a MySQL subdirectory), no environment variables that control initialization are needed or examined, and no pre-existing databases are changed.

The only exception is the MARIADB_AUTO_UPGRADE environment variable. If it's set, it may run mysql_upgrade or mariadb-upgrade, potentially causing changes to the system tables.

Backup and restore

Information on how to perform backup and restore can be found on the MariaDB Knowledge Base Container Backup and Restoration.


SPDX-License-Identifier: MIT

This documentation and the build recipe are licensed as MIT. The container itself contains various software components under various open source licenses listed in the associated Software Bill of Materials (SBOM).

This image is based on SUSE Linux Enterprise Server, a reliable, secure, and scalable server operating system built to power mission-critical workloads in physical and virtual environments.

  • Image Data

    Last Built: 11 Jun 11:16 UTC

    Size: 137.6 MB

    Support Level: L3

  • Health Index

    No vulnerabilities found

    Last Scan:

    about 21 hours ago