• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue Mapping bitnami/mysql docker container in Plesk

anatol

New Pleskian
Server operating system version
Ubuntu 20.04.6 LTS
Plesk version and microupdate number
Plesk Obsidian Version 18.0.60
I have problems with bitnami/mysql:8.1.0-debian-11-r57 image container in Plesk.
When I don't any mapping settings the container starts correctly and the DB works properly.
If I set mapping, the container doesn't start al all, but after changing the rights of mapped directories of Ubuntu, I can start the container, but it stops at Starting mysql in background and DB is not available, MySQL server does not start.

No mapping:

1715621403690.png

With mapping:

1715621367254.png

log when the mapping is set:

[38;5;6mmysql [38;5;5m17:03:35.84 [0m
[38;5;6mmysql [38;5;5m17:03:35.84 [0m[1mWelcome to the Bitnami mysql container[0m
[38;5;6mmysql [38;5;5m17:03:35.84 [0mSubscribe to project updates by watching [1mhttps://github.com/bitnami/containers[0m
[38;5;6mmysql [38;5;5m17:03:35.84 [0mSubmit issues and feature requests at [1mhttps://github.com/bitnami/containers/issues[0m
[38;5;6mmysql [38;5;5m17:03:35.84 [0m
[38;5;6mmysql [38;5;5m17:03:35.84 [0m[38;5;2mINFO [0m ==> ** Starting MySQL setup **
[38;5;6mmysql [38;5;5m17:03:35.86 [0m[38;5;2mINFO [0m ==> Validating settings in MYSQL_*/MARIADB_* env vars
[38;5;6mmysql [38;5;5m17:03:35.86 [0m[38;5;2mINFO [0m ==> Initializing mysql database
[38;5;6mmysql [38;5;5m17:03:35.87 [0m[38;5;2mINFO [0m ==> Updating 'my.cnf' with custom configuration
[38;5;6mmysql [38;5;5m17:03:35.87 [0m[38;5;2mINFO [0m ==> Setting slow_query_log option
[38;5;6mmysql [38;5;5m17:03:35.88 [0m[38;5;2mINFO [0m ==> Setting long_query_time option
[38;5;6mmysql [38;5;5m17:03:35.88 [0m[38;5;2mINFO [0m ==> Using persisted data
[38;5;6mmysql [38;5;5m17:03:35.90 [0m[38;5;2mINFO [0m ==> Running mysql_upgrade
[38;5;6mmysql [38;5;5m17:03:35.90 [0m[38;5;2mINFO [0m ==> Starting mysql in background
[38;5;6mmysql [38;5;5m17:12:06.64 [0m
[38;5;6mmysql [38;5;5m17:12:06.64 [0m[1mWelcome to the Bitnami mysql container[0m
[38;5;6mmysql [38;5;5m17:12:06.64 [0mSubscribe to project updates by watching [1mhttps://github.com/bitnami/containers[0m
[38;5;6mmysql [38;5;5m17:12:06.64 [0mSubmit issues and feature requests at [1mhttps://github.com/bitnami/containers/issues[0m
[38;5;6mmysql [38;5;5m17:12:06.64 [0m
[38;5;6mmysql [38;5;5m17:12:06.65 [0m[38;5;2mINFO [0m ==> ** Starting MySQL setup **
[38;5;6mmysql [38;5;5m17:12:06.66 [0m[38;5;2mINFO [0m ==> Validating settings in MYSQL_*/MARIADB_* env vars
[38;5;6mmysql [38;5;5m17:12:06.66 [0m[38;5;2mINFO [0m ==> Initializing mysql database
[38;5;6mmysql [38;5;5m17:12:06.67 [0m[38;5;2mINFO [0m ==> Updating 'my.cnf' with custom configuration
[38;5;6mmysql [38;5;5m17:12:06.67 [0m[38;5;2mINFO [0m ==> Setting slow_query_log option
[38;5;6mmysql [38;5;5m17:12:06.68 [0m[38;5;2mINFO [0m ==> Setting long_query_time option
[38;5;6mmysql [38;5;5m17:12:06.68 [0m[38;5;2mINFO [0m ==> Using persisted data
[38;5;6mmysql [38;5;5m17:12:06.70 [0m[38;5;2mINFO [0m ==> Running mysql_upgrade
[38;5;6mmysql [38;5;5m17:12:06.70 [0m[38;5;2mINFO [0m ==> Starting mysql in background
[38;5;6mmysql [38;5;5m17:22:07.21 [0m[38;5;1mERROR[0m ==> MySQL failed to start
[38;5;6mmysql [38;5;5m17:22:07.67 [0m
[38;5;6mmysql [38;5;5m17:22:07.67 [0m[1mWelcome to the Bitnami mysql container[0m
[38;5;6mmysql [38;5;5m17:22:07.67 [0mSubscribe to project updates by watching [1mhttps://github.com/bitnami/containers[0m
[38;5;6mmysql [38;5;5m17:22:07.67 [0mSubmit issues and feature requests at [1mhttps://github.com/bitnami/containers/issues[0m
[38;5;6mmysql [38;5;5m17:22:07.67 [0m
[38;5;6mmysql [38;5;5m17:22:07.68 [0m[38;5;2mINFO [0m ==> ** Starting MySQL setup **
[38;5;6mmysql [38;5;5m17:22:07.69 [0m[38;5;2mINFO [0m ==> Validating settings in MYSQL_*/MARIADB_* env vars
[38;5;6mmysql [38;5;5m17:22:07.70 [0m[38;5;2mINFO [0m ==> Initializing mysql database
[38;5;6mmysql [38;5;5m17:22:07.70 [0m[38;5;2mINFO [0m ==> Updating 'my.cnf' with custom configuration
[38;5;6mmysql [38;5;5m17:22:07.71 [0m[38;5;2mINFO [0m ==> Setting slow_query_log option
[38;5;6mmysql [38;5;5m17:22:07.71 [0m[38;5;2mINFO [0m ==> Setting long_query_time option
[38;5;6mmysql [38;5;5m17:22:07.71 [0m[38;5;2mINFO [0m ==> Using persisted data
[38;5;6mmysql [38;5;5m17:22:07.73 [0m[38;5;2mINFO [0m ==> Running mysql_upgrade
[38;5;6mmysql [38;5;5m17:22:07.74 [0m[38;5;2mINFO [0m ==> Starting mysql in background

MySQL official images are only for MySQL 8.0 and they will not create images for debian any more. I asked about MySQL 8.1 and the answer was:
8.1 was the first "innovation" release and is no longer updated (it was superseded by 8.2 and then 8.3 and now 8.4). After 8.0 we stopped publishing Debian based images and only publish Oracle Linux based images since it is more supported by MySQL upstream releases.

Edit: 8.0 is still an active release and the images will continue to be built (on Debian and Oracle Linux) until its end of life.
 
After research, I discovered that Bitnami containers are non-root containers, started by default with a non-root user.
The mounted files and directories must have the proper permissions for the UID 1001.
To make everything working properly I did in this way (if there are better solutions, please share):
Image: bitnami/mysql:8.0.36-debian-11-r20

Create directories on Ubuntu and set the rights:
Code:
cd /var/docker
mkdir mysql80 mysql80_config
sudo chmod -R 775 mysql80 mysql80_config

Create a file for custom MySQL settings:
Code:
touch mysql80_config/my_custom.cnf

The name "my_custom.cnf" is specified in Bitnami documentation. The app is looking for a file with such a name.

Container settings in Plesk Obsidian:
image

Timezone: 'Europe/Berlin' is not accepted in my.cnf in this way:

Code:
[mysqld]
default_time_zone='Europe/Berlin'

When is set like this, the container starts in bakground and the quotes ('Europe/Berlin') are lost after container restart (I tested it in my.cnf, not in my_custom.cnf).
So I found another way - to set it as variable in Plesk, see the screenshot.
Is there any way to run the container as "root" using environment variable as I did for timezone?
 
Back
Top