Search code examples
dockerdocker-for-windows

Docker containers are running but can't access them


I'm learning docker and have started with Official get started Tutorial.

My problem is on step 3.

Here's my docker-compose.yml file (it's the same as in the tutorial)

version: "3"
services:
web:
# replace username/repo:tag with your name and image details
image: username/repo:tag
deploy:
  replicas: 5
  resources:
    limits:
      cpus: "0.1"
      memory: 50M
  restart_policy:
    condition: on-failure
ports:
  - "4000:80"
 networks:
  - webnet

I followed the instructions in the link. The only thing that was different, when I ran docker swarm init and got this response Error response from daemon: could not choose an IP address to advertise since this system has multiple addresses on different interfaces (10.0.2.15 on eth0 and 192.168.99.100 on eth1) - specify one with --advertise-addr I ran docker swarm init --advertise-addr=192.168.99.100 as that's the IP address the command docker-machine ip default returns

The problem All the 5 replicas of the containers are up and running but I can't access the app on 192.168.99.100:4000. What's wrong?

Here is what I get now Debugging commands results

Notes:

  • Using Docker Toolbox for Windows (Windows 10 Home)
  • I tried the command docker swarm init --advertise-addr=192.168.99.100 listen-addr=192.168.99.100 too

Solution

  • It turned out something was wrong with docker-machine itself. After recreating it, everything worked all right.

    Hope this will help anyone