Skip to content

[Request]: Named volume permissions consistent with local folder share volume #745

@mungler

Description

@mungler

Feature or enhancement request details

If I create a named volume and attempt start a MySQL container, I get an error that the mysqld process cannot write to the specified volume:

rory@Zaphod ~> /usr/local/bin/container run --rm --publish 3336:3306 -v mysql-data:/var/lib/mysql -e MYSQL_DATABASE=<redacted> -e MYSQL_USER=<redacted> -e MYSQL_PASSWORD=<redacted> docker.io/percona/percona-server:8.0.34-26.1-multi --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --log_bin_trust_function_creators=1
Initializing database            
mysqld: Can't create/write to file '/var/lib/mysql/is_writable' (OS errno 13 - Permission denied)

However, if instead I pass a local directory path, everything starts up fine:

rory@Zaphod ~ [1]> mkdir $DATA_ROOT/volumes/mysql-data
rory@Zaphod ~> /usr/local/bin/container run --rm --publish 3336:3306 -v $DATA_ROOT/volumes/mysql-data:/var/lib/mysql -e MYSQL_DATABASE=<redacted> -e MYSQL_USER=<redacted> -e MYSQL_PASSWORD=<redacted> docker.io/percona/percona-server:8.0.34-26.1-multi --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --log_bin_trust_function_creators=1
Initializing database            
2025-10-09T11:51:35.049004Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2025-10-09T11:51:35.049044Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.34-26) initializing of server in progress as process 9
2025-10-09T11:51:35.050734Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2025-10-09T11:51:35.056304Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2025-10-09T11:51:35.297262Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.

Shouldn't the permissions model be the same whether I use a local directory path or a named volume?

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions