run docker exec from swarm manager

前端 未结 2 2009
挽巷
挽巷 2020-12-20 18:25

I have two worker nodes: worker1 and worker2 and one swarm manager. I\'m running all the services in the worker nodes only. I need to run from the manager docker exec to acc

2条回答
  •  萌比男神i
    2020-12-20 18:55

    If this helps, nowadays you can create the overlay network with --attachable flag to enable any container to join the network. This is great feature as it allows a lot of flexibility.

    E.g.

    $ docker network create --attachable --driver overlay my-network
    $ docker service create --network my-network --name web --publish 80:80 nginx
    $ docker run --network=my-network -ti alpine sh
    $ wget -qO- web
    
    
    
    
    ....
    

提交回复
热议问题