I’m new to docker and following this tutorial https://docs.docker.com/get-started/part4/#configure-a-docker-machine-shell-to-the-swarm-manager but stuck at this step
I can’t connect to a website which running in service in virtual machine :
-> % curl 192.168.99.100
curl: (7) Failed to connect to 192.168.99.100 port 80: Connection refused
Some investigations:
-> % docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
myvm1 * virtualbox Running tcp://192.168.99.100:2376 v18.09.0
myvm2 - virtualbox Running tcp://192.168.99.101:2376 v18.09.0
-> % docker-machine ssh myvm2 "docker logs 76fe7af9a731"
* Serving Flask app "app" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://0.0.0.0:80/ (Press CTRL+C to quit)
docker-compose.yml
version: "3"
services:
web:
image: thaihoa311/learn-docker:part2
deploy:
replicas: 5
resources:
limits:
cpus: "0.1"
memory: 50M
restart_policy:
condition: on-failure
ports:
- "4000:80"
networks:
- webnet
networks:
webnet:
Dockerfile
FROM python:2.7-slim
WORKDIR /app
COPY . /app
RUN pip install --trusted-host pypi.python.org -r requirements.txt
EXPOSE 80
ENV NAME world
CMD ["python", "app.py"]