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

mysql + cannot change /var/lib/mysql/ ownership #1007

Closed
mauro-ni opened this issue Jun 9, 2017 · 4 comments
Closed

mysql + cannot change /var/lib/mysql/ ownership #1007

mauro-ni opened this issue Jun 9, 2017 · 4 comments

Comments

@mauro-ni
Copy link

mauro-ni commented Jun 9, 2017

Info:

  • Docker version: 17.03.1-ce, build c6d412e
  • Laradock commit: 18b6c1b
  • System info: Mac
  • System info disto/version: macOs Sierra 10.12.5

Issue:

mysql_1                | chown: changing ownership of '/var/lib/mysql/': Operation not permitted

Expected behavior:

mysql container should successfully start.


Reproduce:

Use d4m-nfs (https://github.com/IFSight/d4m-nfs)
Use LaraDock in multi site way, direcory structure:

  • BASE_DIR_PATH/laradock
  • BASE_DIR_PATH/projects
  • BASE_DIR_PATH/data

Warning:
BASE_DIR_PATH/data/mysql MUST exist since /tmp is the only directory shared by docker (see https://github.com/IFSight/d4m-nfs)

Adjust .env file as follows:
APPLICATION=../projects
DATA_SAVE_PATH=../data
PHP_VERSION=56


Relevant Code:

# start d4m-nfs
/path/to/d4m-nfs/d4m-nfs.sh

# rebuild everything
docker-compose build --no-cache nginx mysql phpmyadmin workspace php-fpm applications

# start relevant containers
docker-compose up nginx mysql phpmyadmin
@Jon-Alonso
Copy link

Specifying the user in the docker-compose.yml file worked for me.

In the MySQL / MariaDB container section add: user: mysql

@mauro-ni
Copy link
Author

@JohnAlonso Thx, it works!!!!

@crossRT
Copy link

crossRT commented Nov 5, 2019

Specifying the user in the docker-compose.yml file worked for me.

In the MySQL / MariaDB container section add: user: mysql

thank you! you save my day.
your answer helps me to resolve a similar issue on Kubernetes.
https://kubernetes.io/docs/tasks/configure-pod-container/security-context/

Once again, thank you!

@arnold-plxr
Copy link

Specifying the user in the docker-compose.yml file worked for me.

In the MySQL / MariaDB container section add: user: mysql

Thank you! Your solution worked for me.

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

No branches or pull requests

6 participants