Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access denied in container because volume is mounted as root, with non-root container #98

Open
Richard87 opened this issue Jan 2, 2020 · 0 comments

Comments

@Richard87
Copy link

I have the same problem with bitnami/mysql, the process runs with UID 1001 ( as reported inside the container), but the volume is mounted with the root as owner, and with readonly:

podman run --rm -it --mount type=bind,source=/media/containers/podman/richard/storage/volumes/api_db/_data,destination=/bitnami/mysql,bind-propagation=z bitnami/mysql:5.7 bash

mysql 14:55:41.41 
mysql 14:55:41.41 Welcome to the Bitnami mysql container
mysql 14:55:41.41 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-mysql
mysql 14:55:41.41 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-mysql/issues
mysql 14:55:41.41 Send us your feedback at containers@bitnami.com
mysql 14:55:41.41 

1001@15dc89c7d81c:/$ ls -la /bitnami/mysql 
total 8
drwxr-xr-x 2 root root 4096 Jan  2 12:57 .
drwxr-xr-x 3 root root 4096 Jan  2 06:56 ..
1001@15dc89c7d81c:/$ echo $UID
1001
1001@15dc89c7d81c:/$ 

My docker compose file:

version: "3.5"

services:
  db:
    restart: unless-stopped
    image: bitnami/mysql:5.7
    ports:
      - 127.0.0.1:3309:3306
    environment:
      - MYSQL_ROOT_PASSWORD=xxx
      - MYSQL_DATABASE=xxx
    volumes:
      - db:/bitnami/mysql
volumes:
  db: ~

Originally posted by @Richard87 in #41 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant