MySQL
Deployment Mode

# 1. Create a Docker network
docker network create asgard

# 2. Create a Docker volume
docker volume create sandbox-home # ensure volume is empty

# 3. Create the MySQL container
docker run -d -v sandbox-home:/var/lib/mysql  --name mysqlserver -e MYSQL_ROOT_PASSWORD=root mysql:8.0.12

# 4. Create the phpMyAdmin container
docker run -d --name myphpmyadmin -e PMA_HOST=mysqlserver -p 8080:80 phpmyadmin/phpmyadmin

# 5. Add the MySQL container to the network
# docker network connect NETWORK CONTAINER
docker network connect asgard mysqlserver

# 6. Add the phpMyAdmin container to the network
docker network connect asgard myphpmyadmin

http://localhost:8080/ #root, root
		
# 1. Create a Docker network
docker network create asgard

# 2. Create a Docker volume
docker volume create sandbox-home # ensure volume is empty

# 3. Create the MySQL container
docker run -d -v sandbox-home:/var/lib/mysql  --name mysqlserver --network asgard -e MYSQL_ROOT_PASSWORD=root mysql:8.0.12

# 4. Create the phpMyAdmin container
docker run -d --network asgard -e PMA_HOST=mysqlserver -p 8080:80 phpmyadmin/phpmyadmin

http://localhost:8080/ #root, root
		
Reference
  • How to install MySQL and phpMyAdmin with Docker