O comando docker service create -p 8080:3000 aluracursos/barbearia foi executado na maquina manager do Cluster Swarm (vm1), porém não consegui entender como o serviço foi criado na VM2, nesse caso da aula, e está executando nela, pois se eu der um docker service ps, aparece este hots com o serviço rodando. Obrigado.
docker@vm1:~$ docker service ls
ID NAME MODE REPLICAS IMAGE PORTS
docker@vm1:$ docker service create -p 8080:3000 aluracursos/barbearia
n5enjmtbhybrmdjd5d0gql7ds
overall progress: 1 out of 1 tasks
1/1: running [==================================================>]
verify: Service converged
docker@vm1:$ docker service ls
ID NAME MODE REPLICAS IMAGE PORTS
n5enjmtbhybr crazy_turing replicated 1/1 aluracursos/barbearia:latest *:8080->3000/tcp
docker@vm1:~$ docker service ps n5
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
ckuvv65en8dc crazy_turing.1 aluracursos/barbearia:latest vm2 Running Running about a minute ago
docker@vm2:~$ docker service create -p 8080:3000 -d aluracursos/barbearia Error response from daemon: This node is not a swarm manager. Worker nodes can't be used to view or modify cluster state. Please run this command on a manager node or promote the current node to a manager. docker@vm2:~$ docker container ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e4c27e4598a9 aluracursos/barbearia:latest "/bin/sh -c 'node se…" 4 minutes ago Up 4 minutes crazy_turing.1.ckuvv65en8dc6h95a4ag3mwz3