so before we create our swarm service, we need create our overlay network:
$ docker network create --driver overlay my-net
then create service with parameter "--network my-net".
for example:
$ docker service create --replicas 1 --name consul --network my-net -p 8300:8300 -p 8301:8301 -p 8301:8301/udp -p 8302:8302 -p 8302:8302/udp -p 8400:8400 -p 8500:8500 -p 8600:8600 consul agent -server -bootstrap-expect 1 -ui -client 0.0.0.0 -advertise 192.168.3.132 -node=swarm1
Last:
Thanks!
No comments:
Post a Comment