docker-swarm

docker-swarm

关闭防火墙,重启docker

service docker restart

  1. docker service create --name demo busybox sh -c "while true;do sleep 3600;done"

  2. hostnamectl set-hostname

docker service create --name mysql --env MYSQL_ROOT_PASSWORD=root --env MYSQL_DATABASE=wordpress --network demo --mount type=volume,source=mysql-data,destination=/var/lib/mysql mysql:5.7.21

docker service create --name mysql --env MYSQL_ROOT_PASSWORD=root --env MYSQL_DATABASE=wordpress --mount type=volume,source=mysql-data,destination=/var/lib/mysql
--network demo mysql

docker service create --name wordpress -p 80:80 --env WORDPRESS_DB_PASSWORD=root --env WORDPRESS_DB_HOST=mysql --network demo wordpress

你可能感兴趣的:(docker-swarm)