• The script installation provided by DaoCloud is recommended

curl -sSL get.daocloud.io/docker | sh

  • To configure the image accelerator, add the following content to /etc/docker-daemon. json

{“registry-mirrors”: [“hub-mirror.c.163.com”]}

  • You need to restart the Docker service and log in to the current user again

sudo systemctl restart docker.service

  • Install MySQL

$ docker pull mysql:latest

  • Run and map host ports

$ docker run -itd –name mysql-test -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql