You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BUT this uid and gid are already used on the host system.
DATA_DIR looks like that:
drwxr-xr-x 8 polkitd ssh_keys 4.0K 2018-03-20 13:38:30 mysql_data
And user polkitd and group ssh_keys can have different access rights as the indended mysql...
How can I start the mysql container and have uid and gid as input parameter? (of course I have to create the mysql user and group on the host system first).
The text was updated successfully, but these errors were encountered:
Just use --user on docker run (or the compose equivalent) to run as whatever user you want. They'll need to already own the folders you are mounting in since it has to skip chowning since it is not root:
RHEL 7.4 (SELinux enabled)
docker version 1.12.6
docker compose 1.15
docker compose file version 2
mysql 5.7
mysql/5.7/Dockerfile:
line 4: RUN groupadd -r mysql && useradd -r -g mysql mysql
=> user mysql uid=999 and group mysql gid=999
docker-compose file:
mysql:
image: mysql:5.7
...
volumes:
- "${DATA_DIR}/mysql_data:/var/lib/mysql:Z"
- "${BACKUP_DIR}/mysql_backup:/mysql_backup:Z"
BUT this uid and gid are already used on the host system.
DATA_DIR looks like that:
drwxr-xr-x 8 polkitd ssh_keys 4.0K 2018-03-20 13:38:30 mysql_data
And user polkitd and group ssh_keys can have different access rights as the indended mysql...
How can I start the mysql container and have uid and gid as input parameter? (of course I have to create the mysql user and group on the host system first).
The text was updated successfully, but these errors were encountered: