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
docker service create --name wordpress -p 80:80 --env WORDPRESS_DB_PASSWORD=root --env WORDPRESS_DB_HOST=mysql --network demo wordpress
命令如实按照老师给的敲进去。
然后报错了,
用docker service ps wordpress发现:
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
l8qnn0zlkhit wordpress.1 wordpress:latest swarm-worker1 Running Running 12 seconds ago
fy3apqo29r8x \_ wordpress.1 wordpress:latest swarm-worker1 Shutdown Failed 18 seconds ago "task: non-zero exit (1)"
6dad0hv9rnrt \_ wordpress.1 wordpress:latest swarm-worker1 Shutdown Failed 52 seconds ago "task: non-zero exit (1)"
lbzsf8o33v78 \_ wordpress.1 wordpress:latest swarm-worker1 Shutdown Failed about a minute ago "task: non-zero exit (1)"
hobffy3tpxhn \_ wordpress.1 wordpress:latest swarm-worker1 Shutdown Failed 2 minutes ago "task: non-zero exit (1)"
请看,都是Failed信息,详细日志里"task: non-zero exit (1)"不知道是什么意思?