8000 Assigning service published ports to IP · Issue #26696 · moby/moby · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Assigning service published ports to IP #26696
Open
@rtuk

Description

@rtuk

Description
When you create a service with a published port, this port is assigned to all host IPs (0.0.0.0). You cannot create a new service on the same port because this port is already in use.
This issue was first created in docker/swarm

Steps to reproduce the issue:

  1. docker service create --name test -p 192.169.2.8:80:80 nginx

and

  1. docker service create --name test -p 80:80 nginx
  2. docker service create --name test2 -p 80:80 nginx

Describe the results you received:
invalid argument "192.169.2.8:80:80" for p: HostIP is not supported by a service.
See 'docker service create --help'.

and

  1. 1wwed5dix1xga27583dh9bh6r
  2. Error response from daemon: rpc error: code = 3 desc = port '80' is already in use by service 'test' (1wwed5dix1xga27583dh9bh6r)

Describe the results you expected:
If a host has multiple IP addresses it should be possible to publish container ports on a specific IP address.

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

Client:
 Version:      1.12.1
 API version:  1.24
 Go version:   go1.7.1
 Git commit:   6f9534c
 Built:        Thu Sep  8 10:31:18 2016
 OS/Arch:      darwin/amd64

Server:
 Version:      1.12.1
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   23cf638
 Built:        Thu Aug 18 17:52:38 2016
 OS/Arch:      linux/amd64

Output of docker info:

Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 1.12.1
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 1
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: null bridge overlay host
Swarm: active
 NodeID: 14agfq1cb2asswaxlj9m9m4qd
 Is Manager: true
 ClusterID: dcj2b2yl0lt7k0b1wyq2lfl3j
 Managers: 1
 Nodes: 1
 Orchestration:
  Task History Retention Limit: 5
 Raft:
  Snapshot Interval: 10000
  Heartbeat Tick: 1
  Election Tick: 3
 Dispatcher:
  Heartbeat Period: 5 seconds
 CA Configuration:
  Expiry Duration: 3 months
 Node Address: 192.168.65.2
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.4.20-moby
Operating System: Alpine Linux v3.4
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 1.952 GiB
Name: moby
ID: BLI4:JSAG:E5EJ:YI67:QCOY:5PVH:JOZA:TJEQ:IX7Q:A7CT:YYXQ:GE6T
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 34
 Goroutines: 120
 System Time: 2016-09-19T08:05:04.123825143Z
 EventsListeners: 1
No Proxy: *.local, 169.254/16
Registry: https://index.docker.io/v1/
Insecure Registries:
 127.0.0.0/8

Additional environment details (AWS, VirtualBox, physical, etc.):
Native docker on Mac OSX El Capitan (10.11.6)
Results are the same on docker on CentOS 7

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0