docker-images/pluie/alpine-mysql
2016-07-29 14:04:25 +02:00
..
install.d all images from offical alpine:3.4 2016-07-29 14:04:25 +02:00
pre-init.d all images from offical alpine:3.4 2016-07-29 14:04:25 +02:00
.gitignore adding image pluie/alpine-mysql 2016-07-25 05:02:04 +02:00
build adding image pluie/alpine-mysql 2016-07-25 05:02:04 +02:00
Dockerfile all images from offical alpine:3.4 2016-07-29 14:04:25 +02:00
files.tar all images from offical alpine:3.4 2016-07-29 14:04:25 +02:00
main.sh all images from offical alpine:3.4 2016-07-29 14:04:25 +02:00
README.md Update README.md 2016-07-29 11:48:56 +02:00

pluie/alpine-mysql

Extend pluie/alpine with mysql (mariadb) 5.5.47

Image Size

  • image ~ 160 MB

Image Volumes

/var/lib/mysql : mysql database directory
/dump : directory to store various mysql scripts

ENV variables

MYSQL_DATABASE : create specified database at startup
MYSQL_USER : create specified user at startup (and grant all rights to MYSQL_DATABASE)
MYSQL_PASSWORD
MYSQL_ROOT_PASSWORD : don't really need it. a random root password is generated if none

Image Usage

$ docker run --name mysql -p 3306 -v /home/docker/db/mysql:/var/lib/mysql -v /home/docker/db/dump:/dump -e MYSQL_DATABASE=mybase -e MYSQL_USER=dev -e MYSQL_PASSWORD=mysql -it pluie/alpine-mysql

Root Usage

a root user is created at startup (if database directory is empty)
root login is permit only on localhost
to do things without files you can run :

$ docker exec -it mysql "mysql -uroot"

to do things with files you can log in to container :

docker exec -it mysql bash

then

$ mysql -uroot mybase < /dump/mydump.sql

etc.

User usage

locally (on host) you can run (with appropriate user : pass) :

mysql -h ipmysqlcontainer -udev -pmysql

or if you want use the mysql client of the container :

docker exec -it mysql "mysql -h ipmysqlcontainer -udev -pmysql"

to link this container to another, use the default docker behavior :

docker run --name mycontainer --link mysql:db ...