mmorejon/playing-docker-swarm-docker-machine

How to run docker-compose.yml in SWARM?

Opened this issue · 2 comments

Hi,

Please provide me the step that how to run docker-compose.yml as below after SWARM script run?

version: '3.1'

services:
  a:
    image: tutum/hello-world
  b:
    image: tutum/hello-world

Hi,
I'm glad to help you! One point, the tutum images are not available. What services do you need? What docker image you want to deploy?

Inside stack folder you can find some samples like this:


version: '3.4'
services:
  web:
    image: dockercloud/hello-world
    ports:
      - target: 80
        published: 80
        protocol: tcp
        mode: ingress
    deploy:
      mode: replicated
      replicas: 6
      placement:
        preferences:
          - spread: node.labels.zone
        constraints:
- node.role == worker

Let me know if this example was helpful for you!

Hi,

Thanks a lot for your reply

As per your statement - "the tutum images are not available." but still available in docker hub "https://hub.docker.com/r/tutum/hello-world/"? so I am confused.

Second question - sorry I am even don't understand the difference between bootstrap.sh?

Third question - what is the number of worker/Manager required when I am executing the docker-compose.yml? and It is necessarily that the version must be in version: '3.4'?

After executing $ docker $(docker-machine config m1) node ls
how it manage with docker-compose.yml?

ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS
z5ig2iskg2g15uxdg2jg1pgeo *   m1                  Ready               Active              Leader
tp8fkcmscdook3sy2gwaoq78r     m2                  Ready               Active              Reachable
vbclyw1aundro24buawookv7g     m3                  Ready               Active              Reachable
js2udlnwvpofcqrkl9tj8615e     w1                  Ready               Active              
7e4obwxe3g2qywv7dfwk5vuzc     w2                  Ready               Active              
uxctf1u8t5mk3ika1mwt2spzq     w3                  Ready               Active              

Please explain below as well if possible.

ports:
      - target: 80
        published: 80
        protocol: tcp
        mode: ingress
    deploy:
      mode: replicated
      replicas: 6
      placement:
        preferences:
          - spread: node.labels.zone
        constraints:
- node.role == worker

Sorry for my many question?