Skip to content
Mattias Martikainen edited this page Jun 19, 2017 · 3 revisions

MySQL docker container The image can be found here MySQL @ Docker HUB

Adding MYSQL to your docker environment

docker create --name mysql --restart=always -e TZ=Europe/Stockholm -e GUID=1000 -e PUID=1000 -e MYSQL_ROOT_PASSWORD=your-password -v /Docker/Mysql/datadir:/var/lib/mysql mysql:latest

Explanation

docker create --name mysql Creating the container with the name "mysql"

--restart=always makes the container start on boot

-e TZ=Europe/London Timezone

-e GUID=1000The ID of our users group

-e PUID=1000The ID of our user

-e MYSQL_ROOT_PASSWORD=your-password mysql root password

-v /Docker/Mysql/datadir:/var/lib/mysql Pointing our database to the hosts path

mysql:latest the name of the image we use from docker hub

Clone this wiki locally