Skip to content

A minimal lightweight mysql docker image based on alpine with mysql (~179 MB)

License

Notifications You must be signed in to change notification settings

jrichardsz/alpine-mysql

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A minimal lightweight mysql docker image based on alpine with mysql (~ about 179 MB)

How to build image

git clone .. , then:

docker build -t batlley/alpine-mysql .

How to start a container

To start the server without creating an initial user/database:

docker run -it --rm \
  --name mysql \
  -v $(pwd):/data \
  -p 3306:3306 \
  batlley/alpine-mysql

OR

To start the server and create an initial user (e.g john/doe), database (e.g my_db) and specify root password (root_pass):

docker run -it --rm \
   --name mysql \
   -p 3306:3306 \
   -v $(pwd):/data \
   -e MYSQL_DATABASE=my_db \
   -e MYSQL_USER=john \
   -e MYSQL_PASSWORD=doe \
   -e MYSQL_ROOT_PASSWORD=root_pass  \
   batlley/alpine-mysql

How to manage mysql (mysql cli)

Once the container is running, run:

docker exec -it mysql sh

to connect, then type: mysql -uroot -p

About

A minimal lightweight mysql docker image based on alpine with mysql (~179 MB)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%