专属域名
文档搜索
轩辕助手
Run助手
邀请有礼
返回顶部
快速返回页面顶部
收起
收起工具栏
轩辕镜像 官方专业版
轩辕镜像 官方专业版轩辕镜像 官方专业版官方专业版
首页个人中心搜索镜像

交易
充值流量我的订单
工具
提交工单镜像收录一键安装
Npm 源Pip 源Homebrew 源
帮助
常见问题
其他
关于我们网站地图

官方QQ群: 1072982923

bitnami/mariadb Docker 镜像 - 轩辕镜像

mariadb
bitnami/mariadb
自动构建
Bitnami Secure Image for MariaDB是一款针对MariaDB数据库开发的预配置安全镜像,它集成自动化安全补丁、合规性检查工具及加固配置,可快速在容器、虚拟机或云平台等环境中部署,提供持续更新与维护支持,有效降低部署风险,确保数据库运行的稳定性与安全性,满足企业级应用对数据保护的严格需求。
206 收藏0 次下载
🚀专业版镜像服务,面向生产环境设计
版本下载
🚀专业版镜像服务,面向生产环境设计

Bitnami Secure Image for MariaDB

What is MariaDB?

MariaDB is an open source, community-developed SQL database server that is widely in use around the world due to its enterprise features, flexibility, and collaboration with leading tech firms.

Overview of MariaDB Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.

TL;DR

console
docker run --name mariadb -e ALLOW_EMPTY_PASSWORD=yes REGISTRY_NAME/bitnami/mariadb:latest

Warning: These quick setups are only intended for development environments. You are encouraged to change the insecure default credentials and check out the available configuration options in the Configuration section for a more secure deployment.

Why use Bitnami Secure Images?

Those are hardened, minimal CVE images built and maintained by Bitnami. Bitnami Secure Images are based on the cloud-optimized, security-hardened enterprise OS Photon Linux. Why choose BSI images?

  • Hardened secure images of popular open source software with Near-Zero Vulnerabilities
  • Vulnerability Triage & Prioritization with VEX Statements, KEV and EPSS Scores
  • Compliance focus with FIPS, STIG, and air-gap options, including secure bill of materials (SBOM)
  • Software supply chain provenance attestation through in-toto
  • First class support for the internet’s favorite Helm charts

Each image comes with valuable security metadata. You can view the metadata in our public catalog here. Note: Some data is only available with commercial subscriptions to BSI.

!Alt text !Alt text

If you are looking for our previous generation of images based on Debian Linux, please see the Bitnami Legacy registry.

Choosing between the Standard and Minimal image

This asset is available in two flavors: Standard and Minimal; designed to address different use cases and operational needs.

Standard images

The standard images are full-featured, production-ready containers built on top of secure base operating systems. They include:

  • The complete runtime and commonly used system tools.
  • A familiar Linux environment (shell, package manager, debugging utilities).
  • Full compatibility with most CI/CD pipelines and existing workloads.

Recommended for:

  • Development and testing environments.
  • Workloads requiring package installation or debugging tools.
  • Applications that depend on system utilities or shared libraries.
Minimal images

The minimal images are optimized, distroless-style containers derived from a stripped-down base. They only ship what’s strictly necessary to run the application; no shell, package manager, or extra libraries. They provide:

  • Smaller size: Faster pull and startup times.
  • Reduced *** surface: Fewer components and potential vulnerabilities.
  • Simpler maintenance: Fewer dependencies to patch or update.

Recommended for:

  • Production environments prioritizing performance and security.
  • Regulated or security-sensitive workloads
  • Containers built via multi-stage builds (e.g., Golang static binaries).

How to deploy MariaDB in Kubernetes?

Deploying Bitnami applications as Helm Charts is the easiest way to get started with our applications on Kubernetes. Read more about the installation in the Bitnami MariaDB Chart GitHub repository.

Why use a non-root container?

Non-root container images add an extra layer of security and are generally recommended for production environments. However, because they run as a non-root user, privileged tasks are typically off-limits. Learn more about non-root containers in our docs.

Supported tags and respective Dockerfile links

Learn more about the Bitnami tagging policy and the difference between rolling tags and immutable tags in our documentation page.

You can see the equivalence between the different tags by taking a look at the tags-info.yaml file present in the branch folder, i.e bitnami/ASSET/BRANCH/DISTRO/tags-info.yaml.

Subscribe to project updates by watching the bitnami/containers GitHub repo.

Get this image

The recommended way to get the Bitnami MariaDB Docker Image is to pull the prebuilt image from the Docker Hub Registry.

console
docker pull REGISTRY_NAME/bitnami/mariadb:latest

To use a specific version, you can pull a versioned tag. You can view the list of available versions in the Docker Hub Registry.

console
docker pull REGISTRY_NAME/bitnami/mariadb:[TAG]

If you wish, you can also build the image yourself by cloning the repository, changing to the directory containing the Dockerfile and executing the docker build command. Remember to replace the APP, VERSION and OPERATING-SYSTEM path placeholders in the example command below with the correct values.

console
git clone [***]
cd bitnami/APP/VERSION/OPERATING-SYSTEM
docker build -t REGISTRY_NAME/bitnami/APP:latest .

Persisting your database

If you remove the container all your data will be lost, and the next time you run the image the database will be reinitialized. To avoid this loss of data, you should mount a volume that will persist even after the container is removed.

For persistence you should mount a directory at the /bitnami/mariadb path. If the mounted directory is empty, it will be initialized on the first run.

console
docker run \
    -e ALLOW_EMPTY_PASSWORD=yes \
    -v /path/to/mariadb-persistence:/bitnami/mariadb \
    REGISTRY_NAME/bitnami/mariadb:latest

or by modifying the docker-compose.yml file present in this repository:

yaml
services:
  mariadb:
  ...
    volumes:
      - /path/to/mariadb-persistence:/bitnami/mariadb
  ...

NOTE: As this is a non-root container, the mounted files and directories must have the proper permissions for the UID 1001.

Connecting to other containers

Using Docker container networking, a MariaDB server running inside a container can easily be accessed by your application containers.

Containers attached to the same network can communicate with each other using the container name as the hostname.

Using the Command Line

In this example, we will create a MariaDB client instance that will connect to the server instance that is running on the same docker network as the client.

Step 1: Create a network
console
docker network create app-tier --driver bridge
Step 2: Launch the MariaDB server instance

Use the --network app-tier argument to the docker run command to attach the MariaDB container to the app-tier network.

console
docker run -d --name mariadb-server \
    -e ALLOW_EMPTY_PASSWORD=yes \
    --network app-tier \
    REGISTRY_NAME/bitnami/mariadb:latest
Step 3: Launch your MariaDB client instance

Finally we create a new container instance to launch the MariaDB client and connect to the server created in the previous step:

console
docker run -it --rm \
    --network app-tier \
    REGISTRY_NAME/bitnami/mariadb:latest mysql -h mariadb-server -u root
Using a Docker Compose file

When not specified, Docker Compose automatically sets up a new network and attaches all deployed services to that network. However, we will explicitly define a new bridge network named app-tier. In this example we assume that you want to connect to the MariaDB server from your own custom application image which is identified in the following snippet by the service name myapp.

yaml
version: '2'

networks:
  app-tier:
    driver: bridge

services:
  mariadb:
    image: REGISTRY_NAME/bitnami/mariadb:latest
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
    networks:
      - app-tier
  myapp:
    image: YOUR_APPLICATION_IMAGE
    networks:
      - app-tier

IMPORTANT:

  1. Please update the YOUR_APPLICATION_IMAGE placeholder in the above snippet with your application image
  2. In your application container, use the hostname mariadb to connect to the MariaDB server

Launch the containers using:

console
docker-compose up -d

Configuration

Environment variables
Customizable environment variables
NameDescriptionDefault Value
ALLOW_EMPTY_PASSWORDAllow MariaDB access without any password.no
MARIADB_AUTHENTICATION_PLUGINMariaDB authentication plugin to configure during the first initialization.nil
MARIADB_ROOT_USERMariaDB database root user.root
MARIADB_ROOT_PASSWORDMariaDB database root user password.nil
MARIADB_USERMariaDB database user to create during the first initialization.nil
MARIADB_PASSWORDPassword for the MariaDB database user to create during the first initialization.nil
MARIADB_DATABASEMariaDB database to create during the first initialization.nil
MARIADB_MASTER_HOSTAddress for the MariaDB master node.nil
MARIADB_MASTER_PORT_NUMBERPort number for the MariaDB master node.3306
MARIADB_MASTER_ROOT_USERMariaDB database root user of the master host.root
MARIADB_MASTER_ROOT_PASSWORDPassword for the MariaDB database root user of the the master host.nil
MARIADB_MASTER_DELAYMariaDB database replication delay.0
MARIADB_REPLICATION_USERMariaDB replication database user.nil
MARIADB_REPLICATION_PASSWORDPassword for the MariaDB replication database user.nil
MARIADB_PORT_NUMBERPort number to use for the MariaDB Server service.nil
MARIADB_REPLICATION_MODEMariaDB replication mode.nil
MARIADB_REPLICATION_SLAVE_DUMPMake a dump on master and update slave MariaDB databasefalse
MARIADB_EXTRA_FLAGSExtra flags to be passed to start the MariaDB Server.nil
MARIADB_INIT_SLEEP_TIMESleep time when waiting for MariaDB init configuration operations to finish.nil
MARIADB_CHARACTER_SETMariaDB collation to use.nil
MARIADB_COLLATEMariaDB collation to use.nil
MARIADB_BIND_ADDRESSMariaDB bind address.nil
MARIADB_SQL_MODEMariaDB Server SQL modes to enable.nil
MARIADB_UPGRADEMariaDB upgrade option.AUTO
MARIADB_SKIP_TEST_DBWhether to skip creating the test database.no
MARIADB_CLIENT_ENABLE_SSLWhether to force SSL for connections to the MariaDB database.no
MARIADB_CLIENT_SSL_CA_FILEPath to CA certificate to use for SSL connections to the MariaDB database server.nil
MARIADB_CLIENT_SSL_CERT_FILEPath to client public key certificate to use for SSL connections to the MariaDB database server.nil
MARIADB_CLIENT_SSL_KEY_FILEPath to client private key to use for SSL connections to the MariaDB database server.nil
MARIADB_CLIENT_EXTRA_FLAGSWhether to force SSL connections with the "mysql" CLI tool. Useful for applications that rely on the CLI instead of APIs.no
MARIADB_STARTUP_WAIT_RETRIESNumber of retries waiting for the database to be running.300
MARIADB_STARTUP_WAIT_SLEEP_TIMESleep time between retries waiting for the database to be running.2
MARIADB_ENABLE_SLOW_QUERYWhether to enable slow query logs.0
MARIADB_LONG_QUERY_TIMEHow much time, in seconds, defines a slow query.10.0
Read-only environment variables
NameDescriptionValue
DB_FLAVORSQL database flavor. Valid values: mariadb or mysql.mariadb
DB_BASE_DIRBase path for MariaDB files.${BITNAMI_ROOT_DIR}/mariadb
DB_VOLUME_DIRMariaDB directory for persisted files.${BITNAMI_VOLUME_DIR}/mariadb
DB_DATA_DIRMariaDB directory for data files.${DB_VOLUME_DIR}/data
DB_BIN_DIRMariaDB directory where executable binary files are located.${DB_BASE_DIR}/bin
DB_SBIN_DIRMariaDB directory where service binary files are located.${DB_BASE_DIR}/sbin
DB_CONF_DIRMariaDB configuration directory.${DB_BASE_DIR}/conf
DB_DEFAULT_CONF_DIRMariaDB default configuration directory.${DB_BASE_DIR}/conf.default
DB_LOGS_DIRMariaDB logs directory.${DB_BASE_DIR}/logs
DB_TMP_DIRMariaDB directory for temporary files.${DB_BASE_DIR}/tmp
DB_CONF_FILEMain MariaDB configuration file.${DB_CONF_DIR}/my.cnf
DB_PID_FILEMariaDB PID file.${DB_TMP_DIR}/mysqld.pid
DB_SOCKET_FILEMariaDB Server socket file.${DB_TMP_DIR}/mysql.sock
DB_DAEMON_USERUsers that will execute the MariaDB Server process.mysql
DB_DAEMON_GROUPGroup that will execute the MariaDB Server process.mysql
MARIADB_DEFAULT_PORT_NUMBERDefault port number to use for the MariaDB Server service.3306
MARIADB_DEFAULT_CHARACTER_SETDefault MariaDB character set.utf8mb4
MARIADB_DEFAULT_BIND_ADDRESSDefault MariaDB bind address.0.0.0.0
Initializing a new instance

When the container is executed for the first time, it will execute the files with extensions .sh, .sql and .sql.gz located at /docker-entrypoint-startdb.d.

In order to have your custom files inside the docker image you can mount them as a volume.

Take into account those scripts are treated differently depending on the extension. While the .sh scripts are executed in all the nodes; the .sql and .sql.gz scripts are only executed in the master nodes. The reason behind this differentiation is that the .sh scripts allow adding conditions to determine what is the node running the script, while these conditions can't be set using .sql nor sql.gz files. This way it is possible to cover different use cases depending on their needs.

NOTE: If you are importing large databases, it is recommended to import them as .sql instead of .sql.gz, as the latter one needs to be decompressed on the fly and not allowing for additional optimizations to import large files.

Passing extra command-line flags to mysqld startup

Passing extra command-line flags to the mysqld service command is possible through the following env var:

  • MARIADB_EXTRA_FLAGS: Flags to be appended to the startup command. No defaults
console
docker run --name mariadb -e ALLOW_EMPTY_PASSWORD=yes -e MARIADB_EXTRA_FLAGS='--max-connect-errors=1000 --max_connections=155' REGISTRY_NAME/bitnami/mariadb:latest

or by modifying the docker-compose.yml file present in this repository:

yaml
services:
  mariadb:
  ...
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
      - MARIADB_EXTRA_FLAGS=--max-connect-errors=1000 --max_connections=155
  ...
Setting character set and collation

It is possible to configure the character set and collation used by default by the database with the following environment variables:

  • MARIADB_CHARACTER_SET: The default character set to use. Default: utf8
  • MARIADB_COLLATE: The default collation to use. Default: utf8_general_ci
Setting the root password on first run

The root user and password can easily be setup with the Bitnami MariaDB Docker image using the following environment variables:

  • MARIADB_ROOT_USER: The database admin user. Defaults to root.
  • MARIADB_ROOT_PASSWORD: The database admin user password. No defaults.
  • MARIADB_ROOT_PASSWORD_FILE: Path to a file that contains the admin user password. This will override the value specified in MARIADB_ROOT_PASSWORD. No defaults.

Passing the MARIADB_ROOT_PASSWORD environment variable when running the image for the first time will set the password of the MARIADB_ROOT_USER user to the value of MARIADB_ROOT_PASSWORD.

console
docker run --name mariadb -e MARIADB_ROOT_PASSWORD=password123 REGISTRY_NAME/bitnami/mariadb:latest

or by modifying the docker-compose.yml file present in this repository:

yaml
services:
  mariadb:
  ...
    environment:
      - MARIADB_ROOT_PASSWORD=password123
  ...

Warning The MARIADB_ROOT_USER user is always created with remote access. It's suggested that the MARIADB_ROOT_PASSWORD env variable is always specified to set a password for the MARIADB_ROOT_USER user. In case you want to allow the MARIADB_ROOT_USER user to access the database without a password set the environment variable ALLOW_EMPTY_PASSWORD=yes. This is recommended only for development.

Allowing empty passwords

By default the MariaDB image expects all the available passwords to be set. In order to allow empty passwords, it is necessary to set the ALLOW_EMPTY_PASSWORD=yes env variable. This env variable is only recommended for testing or development purposes. We strongly recommend specifying the MARIADB_ROOT_PASSWORD for any other scenario.

console
docker run --name mariadb -e ALLOW_EMPTY_PASSWORD=yes REGISTRY_NAME/bitnami/mariadb:latest

or by modifying the docker-compose.yml file present in this repository:

yaml
services:
  mariadb:
  ...
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
  ...
Creating a database on first run

By passing the MARIADB_DATABASE environment variable when running the image for the first time, a database will be created. This is useful if your application requires that a database already exists, saving you from having to manually create the database using the MySQL client.

console
docker run --name mariadb \
    -e ALLOW_EMPTY_PASSWORD=yes \
    -e MARIADB_DATABASE=my_database \
    REGISTRY_NAME/bitnami/mariadb:latest

or by modifying the docker-compose.yml file present in this repository:

yaml
services:
  mariadb:
  ...
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
      - MARIADB_DATABASE=my_database
  ...
Creating a database user on first run

You can create a restricted database user that only has permissions for the database created with the MARIADB_DATABASE environment variable. To do this, provide the MARIADB_USER environment variable and to set a password for the database user provide the MARIADB_PASSWORD variable (alternatively, you can set the MARIADB_PASSWORD_FILE with the path to a file that contains the user password). MariaDB supports different authentication mechanisms, such as pam or mysql_native_password. To set it, use the MARIADB_AUTHENTICATION_PLUGIN variable.

console
docker run --name mariadb \
  -e ALLOW_EMPTY_PASSWORD=yes \
  -e MARIADB_USER=my_user \
  -e MARIADB_PASSWORD=my_password \
  -e MARIADB_DATABASE=my_database \
  REGISTRY_NAME/bitnami/mariadb:latest

or by modifying the docker-compose.yml file present in this repository:

yaml
services:
  mariadb:
  ...
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
      - MARIADB_USER=my_user
      - MARIADB_PASSWORD=my_password
      - MARIADB_DATABASE=my_database
  ...

Note!

_Note: the README for this container is longer than the DockerHub length limit of 25000, so it has been trimmed. The full README can be found at [***]

查看更多 mariadb 相关镜像 →
mariadb logo
mariadb
官方
MariaDB Server 是一款从 MySQL 分叉而来的高性能开源关系型数据库,它继承了 MySQL 的核心架构与兼容性,同时凭借持续的技术革新和社区驱动的优化,在查询效率、并发处理及数据安全等方面实现了显著提升,广泛应用于企业级系统、Web服务平台及各类数据存储场景,成为全球开发者和组织青睐的开源数据库解决方案之一。
60721B+ pulls
上次更新:3 天前
mariadb/maxscale logo
mariadb/maxscale
认证
MariaDB MaxScale 是世界上最先进的数据库代理,它能够实现数据库负载均衡、读写分离、高可用性支持与故障自动切换,同时提供数据分片管理、安全访问控制及性能监控等功能,有效提升数据库系统的运行效率、稳定性与可扩展性,简化复杂数据库环境的管理与维护。
385M+ pulls
上次更新:1 个月前
mariadb/mariadb-operator-enterprise logo
mariadb/mariadb-operator-enterprise
认证
用于配合MariaDB Operator使用的Docker镜像
10K+ pulls
上次更新:1 年前
mariadb/mariadb-prometheus-exporter-ubi logo
mariadb/mariadb-prometheus-exporter-ubi
认证
用于与MariaDB Operator配合使用的Docker镜像
110K+ pulls
上次更新:5 个月前
mariadb/maxscale-prometheus-exporter-ubi logo
mariadb/maxscale-prometheus-exporter-ubi
认证
暂无描述
10K+ pulls
上次更新:5 个月前
bitnamicharts/mariadb logo
bitnamicharts/mariadb
认证
Bitnami提供的用于在Kubernetes环境中部署和管理MariaDB数据库的Helm图表。
10M+ pulls
上次更新:11 天前

轩辕镜像配置手册

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式

登录仓库拉取

通过 Docker 登录认证访问私有仓库

Linux

在 Linux 系统配置镜像服务

Windows/Mac

在 Docker Desktop 配置镜像

Docker Compose

Docker Compose 项目配置

K8s Containerd

Kubernetes 集群配置 Containerd

K3s

K3s 轻量级 Kubernetes 镜像加速

Dev Containers

VS Code Dev Containers 配置

MacOS OrbStack

MacOS OrbStack 容器配置

宝塔面板

在宝塔面板一键配置镜像

群晖

Synology 群晖 NAS 配置

飞牛

飞牛 fnOS 系统配置镜像

极空间

极空间 NAS 系统配置服务

爱快路由

爱快 iKuai 路由系统配置

绿联

绿联 NAS 系统配置镜像

威联通

QNAP 威联通 NAS 配置

Podman

Podman 容器引擎配置

Singularity/Apptainer

HPC 科学计算容器配置

其他仓库配置

ghcr、Quay、nvcr 等镜像仓库

专属域名拉取

无需登录使用专属域名

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

轩辕镜像免费版与专业版有什么区别?

免费版仅支持 Docker Hub 访问,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。

轩辕镜像支持哪些镜像仓库?

专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等;免费版仅支持 docker.io。

流量耗尽错误提示

当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。

410 错误问题

通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。

manifest unknown 错误

先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。

镜像拉取成功后,如何去掉轩辕镜像域名前缀?

使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
bitnami/mariadb
官方博客Docker 镜像使用技巧与技术博客
热门镜像查看热门 Docker 镜像推荐
一键安装一键安装 Docker 并配置镜像源
提交工单
咨询镜像拉取问题请 提交工单,官方技术交流群:1072982923
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
咨询镜像拉取问题请提交工单,官方技术交流群:
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
官方邮箱:点击复制邮箱
©2024-2026 源码跳动
官方邮箱:点击复制邮箱Copyright © 2024-2026 杭州源码跳动科技有限公司. All rights reserved.