ubuntu/mysql Docker Image
MySQL是一款广泛应用于各类Web应用、企业级系统及数据存储场景的开源SQL数据库,它以快速的数据处理能力、稳定的运行性能和高效的多线程架构为核心优势,其长期版本的维护工作由Canonical负责,为用户提供持续的技术支持、安全更新及功能优化服务,是全球众多开发者和企业信赖的数据库解决方案。
ubuntu/mysql is a rock for mysql maintained by https://canonical.com/.
MySQL is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query language in the world. The main goals of MySQL are speed, robustness and ease of use. Read more on the https://dev.mysql.com/doc/refman/8.0/en/.
\https://dev.mysql.com/doc/\]
Tags and Architectures
NOTE: These tags follow a specific naming convention that respects the concept of channels.
| Tags | Supported until | Version | Base | Architectures | |
|---|---|---|---|---|---|
8.4-26.04_stable | aliases8.4-26.04, 8.4-26.04_beta, 8.4-26.04_candidate, 8.4-26.04_edge | 10/2031 | 8.4 | 26.04 | arm64, s390x, amd64 |
8.4-24.04_beta | aliases8.4-24.04_beta | 04/2031 | 8.4 | 24.04 | amd64, s390x, arm64 |
8.0-24.04_beta | aliases8.0-24.04_beta | 07/2031 | 8.0 | 24.04 | s390x, amd64, arm64 |
8.0-22.04_beta | aliases8.0-22.04_edge | - | 8.0 | 22.04 | amd64, s390x, ppc64le, arm64 |
8.0-21.10_beta | aliases8.0-21.10_edge | - | 8.0 | 21.10 | s390x, amd64, arm64, ppc64le |
8.0-21.04_beta | aliases8.0-21.04_edge | - | 8.0 | 21.04 | s390x, arm64, amd64, ppc64le |
8.0-20.04_beta | aliases8.0-20.04_edge | - | 8.0 | 20.04 | s390x, arm64, amd64, ppc64le |
8.4-24.04_edge | aliases8.4-24.04_edge | 04/2031 | 8.4 | 24.04 | amd64, s390x, arm64 |
8.0-24.04_edge | aliases8.0-24.04_edge | 07/2031 | 8.0 | 24.04 | s390x, amd64, arm64 |
Get started
This rock's entrypoint is Pebble, a container-optimized init process that enables the orchestration of a collection of local service processes as an organized set.
\https://documentation.ubuntu.com/pebble/\]
Inspect
To view the https://documentation.ubuntu.com/rockcraft/en/latest/reference/rockcraft-yaml/#services and https://documentation.ubuntu.com/rockcraft/latest/reference/rockcraft-yaml/#checks defined in this rock:
shdocker run --rm ubuntu/mysql:8.4-26.04_stable plan
Run
To run this rock, use any of the usual container runtimes, for example, docker:
shdocker run --name mysql-container \ -e TZ=UTC -e MYSQL_ROOT_PASSWORD=My:S3cr3t -p 30306:3306 \ ubuntu/mysql:8.4-26.04_stable
MySQL server runs on port 30306. Access the server at localhost:30306.
Get logs
To view the logs of the running container, run:
shdocker exec mysql-container pebble logs
Or, for a specific service:
shdocker exec mysql-container pebble logs <service>
Monitor health checks
Rocks may have predefined health checks that you can list by running:
shdocker exec mysql-container pebble checks
The overall health of your container can be inspected via:
shdocker exec mysql-container pebble health
Configuration
Environment variables
| Option | Description | Default |
|---|---|---|
| TZ | Timezone. | UTC |
| MYSQL_ROOT_PASSWORD | Set the password for the root user. This option is mandatory and must not be empty. | None |
| MYSQL_PASSWORD | Set the password for the MYSQL_USER user. | None |
| MYSQL_USER | Create a new user with the MYSQL_PASSWORD password. The user is created with superuser privileges. | None |
| MYSQL_DATABASE | Set the name of the default database. | None |
| MYSQL_ALLOW_EMPTY_PASSWORD | Set up a blank password for the root user. This is not recommended in production. | None |
| MYSQL_RANDOM_ROOT_PASSWORD | Generate a random password for the root user. The password is printed in the logs. | None |
| MYSQL_ONETIME_PASSWORD | Set up a one-time password for the root user. A password change is required on first login. | None |
| MYSQL_INITSB_SKIP_TZINFO | Timezone data is automatically loaded via entrypoint script; set this variable to any non-empty value to disable it. | None |
Volumes
| Option | Description | Default |
|---|---|---|
-v <path>:/var/lib/mysql | Persist data instead of initializing a new database every time you launch a new container. | None |
-v <path>:/etc/mysql/mysql.conf.d/ | Local configuration files for MySQL. | None |
Ports
| Option | Description | Default |
|---|---|---|
-p <port>:3306 | Expose MySQL server on localhost:30306. | None |
\https://github.com/canonical/mysql-rock/issues\] \https://github.com/canonical/mysql-rock\]
Canonical is the provider of this container image. It is the user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within, as well as with https://canonical.com/legal/intellectual-property-policy.
ubuntu 命名空间的其他可用镜像:
镜像拉取方式
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
DockerHub 原生拉取命令
用户好评
来自真实用户的反馈,见证轩辕镜像的优质服务