Hello! Happy New Year!
I am learning docker through great tutorial Share the application | Docker Docs.
Everything from there is understandable.
But I cannot get working swarm on virtual machine created with command
docker-machine create --driver virtualbox myvm1
Shortly what does works and what does not.
DOES WORK
- IT DOES WORK: swarm created on my local physical machine with commands with usual commands:
docker swarm init --advertise-addr 192.168.0.75
docker stack deploy -c docker-compose.yml getstartedlab
- IT DOES WORK: single docker image run on created virtual machine
docker-machine create --driver virtualbox myvm1
docker-machine ssh myvm1
docker pull aeuo/get-started:part2
docker run -p 80:80 aeuo/get-started:part2
BUT DOES NOT WORK
- IT DOES NOT WORK: swarm docker run on created virtual machine
docker-machine ssh myvm1
docker swarm init --advertise-addr 192.168.99.103
cd /hosthome/alek/docker/get-started/
docker stack deploy -c docker-compose.yml getstartedlab
Now logs from VM machine:
docker service logs getstartedlab_web
getstartedlab_web.2.s293w68tanfa@myvm1 | * Serving Flask app “app” (lazy loading)
getstartedlab_web.2.s293w68tanfa@myvm1 | * Environment: production
getstartedlab_web.2.s293w68tanfa@myvm1 | WARNING: Do not use the development server in a production environment.
getstartedlab_web.2.s293w68tanfa@myvm1 | Use a production WSGI server instead.
getstartedlab_web.2.s293w68tanfa@myvm1 | * Debug mode: off
getstartedlab_web.2.s293w68tanfa@myvm1 | * Running on http://0.0.0.0:80/ (Press CTRL+C to quit)
…
sudo netstat -npat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2282/sshd
tcp 0 304 10.0.2.15:22 10.0.2.2:34932 ESTABLISHED 2756/sshd: docker
tcp 0 0 :::80 :::* LISTEN 2611/dockerd
tcp 0 0 :::22 :::* LISTEN 2282/sshd
tcp 0 0 :::2376 :::* LISTEN 2611/dockerd
tcp 0 0 :::2377 :::* LISTEN 2611/dockerd
tcp 0 0 :::7946 :::* LISTEN 2611/dockerd
As you can see service is UP, BUT
curl localhost
curl: (7) Failed to connect to localhost port 80: Connection refused
Single container does work but swarm of containers does not.
So tutorial is broken on part 4.
In which direction I can dig else?