Docker Community Forums

Share and learn in the Docker community.

Cannot route to registered services by name


(Andrew Bell) #1

I love 1.12 so far :heart_eyes: but I’m having trouble accessing services by their name. I’m hoping I’m just doing something wrong. This may not be a Windows specific issue, and just a misunderstanding in how to configure swarm mode networking.

Expected behavior

Creating a docker service named ‘pending’ on port 3000 should allow me to navigate/ping ‘pending:3000’

Actual behavior

Service cannot be reached

Steps to reproduce the behavior

1.) Clone
2.) $ docker compose build
3.) $ docker swarm init
4.) $ docker service create --replicas 1 --name pending recursivechaos/pending-service

I’ve also tried to configure docker networking as following, but without luck.

3.5) $ docker network create -d overlay mynet
4.) $ docker service create --replicas 1 --name pending --publish 3000:3000/tcp --network mynet recursivechaos/pending-service


Running Windows 10 Pro, and docker version 1.12

$docker info

Containers: 1
 Running: 1
 Paused: 0
 Stopped: 0
Images: 14
Server Version: 1.12.0-rc2
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 22
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
 Volume: local
 Network: host bridge overlay null
Swarm: active
 NodeID: 0yklbyqd7c5abuumxhok7xriu
 IsManager: Yes
 Managers: 1
 Nodes: 1
 CACertHash: sha256:b1f2eea025dd15b755f82e33e91014cdd1e640744532b7d722444f8e09d907ce
Runtimes: default
Default Runtime: default
Security Options: seccomp
Kernel Version: 4.4.13-moby
Operating System: Alpine Linux v3.4
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.951 GiB
Name: moby
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Experimental: true
Insecure Registries:

$ docker service inspect pending -p

ID:             8g62l7oj8m5fwca4g1s0mi6un
Name:           pending
Mode:           Replicated
 Replicas:      1
 Strategy:      Spread
 Parallelism:   0
 Image:         recursivechaos/pending-service

$ docker network ls

NETWORK ID          NAME                DRIVER              SCOPE
6fccb3626b08        bridge              bridge              local
cb39a667eb69        docker_gwbridge     bridge              local
6e5b882d316a        host                host                local
1njmqwgiij8i        ingress             overlay             swarm
enndjmsxqdr9        mynet               overlay             swarm
6ffdc31c69e8        none                null                local
5b7bd030cff2        wettech_default     bridge              local

(Andrew Bell) #2

I’m fairly certain this isn’t an issue with Docker for Windows at this point, but rather Docker network configuration. I don’t know if I can delete/move this question, but I’ve created a new one in the Swarm category: How to configure Swarm Service Discovery (1.12)