Dockerfile for a Container with MySQL 5.7.
The Dockerfile, and the shell scripts, have been copied from MySQL GitHub repository, specifically from the following folder: https://github.com/mysql/mysql-docker/tree/mysql-server/5.7
Create Docker Image.
docker build -t <image_name> .
Replace <image_name> with the name you want for the image.
Example.
docker build -t image_mysql57 .
Create Docker Container.
docker run -d -p 3306:3306 --name=<container_name> -e MYSQL_ROOT_PASSWORD=<pwd> -e MYSQL_ROOT_HOST=% \
<image_name>
Replace <container_name> with the name you want for the container,
<pwd> with the password for your root user, and
<image_name> with the name of the image you specified on the Build command above.
Example.
docker run -d -p 3306:3306 --name=container_mysql57 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_ROOT_HOST=% \
image_mysql57
If you have telnet installed on your machine, you can perform a quick test by executing the following command:
telnet localhost 3306
Content type
Image
Digest
Size
105.8 MB
Last updated
over 6 years ago
docker pull davescripts/mysql-57