8000 docker run -p with new syntax is backwards · Issue #2250 · docker/cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
docker run -p with new syntax is backwards #2250
Closed
@phxnsharp

Description

@phxnsharp

Description

If you use the new expanded syntax for publishing ports with the 'docker run' command, the "sense" is backwards from the equivalent option in 'docker service create'.

Granted, the documentation for 'docker run' does not state you can use the new syntax. However, it accepts the format and then does the wrong thing.

Steps to reproduce the issue:
On a one node swarm, these two commands have the same basic effect:

docker service create -p target=80,published=8123 nginx
docker run -p target=8123,published=80 nginx

Needless to say, as a new user to Docker I was a little confused for a while :)

Describe the results you received:
docker run publishes the target and targets the published

Describe the results you expected:
docker run targets the target and publishes the published

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

Output of docker version:

Client: Docker Engine - Community
 Version:           19.03.5
 API version:       1.40
 Go version:        go1.12.12
 Git commit:        633a0ea838
 Built:             Wed Nov 13 07:29:52 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.5
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.12
  Git commit:       633a0ea838
  Built:            Wed Nov 13 07:28:22 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.10
  GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
 runc:
  Version:          1.0.0-rc8+dev
  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Output of docker info:

Client:
 Debug Mode: false

Server:
 Containers: 11
  Running: 0
  Paused: 0
  Stopped: 11
 Images: 9
 Server Version: 19.03.5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: active
  NodeID: pe0tzp554lt1lci6dsy8ltv58
  Is Manager: true
  ClusterID: wyamx5hil21v4inqd1rasktz5
  Managers: 3
  Nodes: 3
  Default Address Pool: 10.0.0.0/8  
  SubnetSize: 24
  Data Path Port: 4789
  Orchestration:
   Task History Retention Limit: 5
  Raft:
   Snapshot Interval: 10000
   Number of Old Snapshots to Retain: 0
   Heartbeat Tick: 1
   Election Tick: 10
  Dispatcher:
   Heartbeat Period: 5 seconds
  CA Configuration:
   Expiry Duration: 3 months
   Force Rotate: 0
  Autolock Managers: false
  Root Rotation In Progress: false
  Node Address: 192.168.2.137
  Manager Addresses:
   192.168.2.129:2377
   192.168.2.136:2377
   192.168.2.137:2377
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
 runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
 init version: fec3683
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.0.0-37-generic
 Operating System: Ubuntu 18.04.3 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 3.827GiB
 Name: ubuntu2
 ID: OECX:IQEM:YP3W:PLEU:HCIE:RISU:BHCZ:FBTS:VWBA:AJRN:4VZ6:S2VI
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: nsharp
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support

Additional environment details (AWS, VirtualBox, physical, etc.):
Happens on both a Windows 10 and Ubuntu 18.04.3 LTS box. Both are VMWare VMs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0