Last active
February 27, 2016 01:42
-
-
Save vhugo/01b0dd227c08e687e0cf to your computer and use it in GitHub Desktop.
Revisions
-
vhugo revised this gist
Feb 27, 2016 . 3 changed files with 4 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,6 @@ FROM mysql:5.5.44 VOLUME /var/lib/mysql RUN usermod -u 1000 mysql CMD ["/entrypoint.sh", "mysqld", "--user=mysql", "--datadir=/var/lib/mysql"] This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,3 +8,5 @@ When trying to add a volume to a container for a [MySQL Docker](https://github.c docker run -d --name mysql-5.5.44 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=somepassword4R00T \ -v /Users/your_user/data/mysql:/var/lib/mysql your_user/mysql ``` If you already have data, you might not need `-e MYSQL_ROOT_PASSWORD=somepassword4R00T` as part of the command. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +0,0 @@ -
vhugo revised this gist
Feb 26, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ When trying to add a volume to a container for a [MySQL Docker](https://github.c ## Using this thing - download `Dockerfile` and `docker-permfix.sh` - in you Terminal, go to the directory you have these files and run `docker build -t your_user/mysql .` - then to create your container, run this: ``` docker run -d --name mysql-5.5.44 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=somepassword4R00T \ -v /Users/your_user/data/mysql:/var/lib/mysql your_user/mysql -
vhugo revised this gist
Feb 26, 2016 . 1 changed file with 9 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,10 @@ When trying to add a volume to a container for a [MySQL Docker](https://github.com/dockerfile/mysql) on Mac OSX, I had permission issues to create the database files. I create a new image based on the [MySQL Docker](https://github.com/dockerfile/mysql) image to fix the issue before running the server. Got the idea from [this comment](https://github.com/boot2docker/boot2docker/issues/581#issuecomment-62491280) and [this other one](https://github.com/docker-library/mysql/issues/99#issuecomment-152655145) ## Using this thing - download `Dockerfile` and `docker-permfix.sh` - in you Terminal, go to the directory you have these files and run `docker build -t your_user/mysql .` - the run this to create your container: ``` docker run -d --name mysql-5.5.44 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=somepassword4R00T \ -v /Users/your_user/data/mysql:/var/lib/mysql your_user/mysql ``` -
vhugo created this gist
Feb 26, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ FROM mysql:5.5.44 VOLUME /var/lib/mysql COPY ./docker-permfix.sh /permfix.sh RUN chmod 755 /permfix.sh CMD ["/permfix.sh"] This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ When trying to add a volume to a container for a docker mysql on Mac OSX, I was having permission issues to create the database files. I solved by creating a new image based on the docker mysql image to fix the issue before running the server. Got the idea from [this comment](https://github.com/boot2docker/boot2docker/issues/581#issuecomment-62491280) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ #!/bin/bash # Working around to solve permission issue with Mac OSX # when the hosting volume for data. set -e usermod -u 1000 mysql exec /entrypoint.sh mysqld --user=mysql --datadir=/var/lib/mysql