Skip to content

[19.03 backport] Reverse order of long-form ports - #2261

Merged
silvin-lubecki merged 1 commit into
docker:19.03from
zappy-shu:19.03_backport_2250-reverse-port-long-format-order
Jan 16, 2020
Merged

silvin-lubecki merged 1 commit into
docker:19.03from
zappy-shu:19.03_backport_2250-reverse-port-long-format-order

Conversation

@zappy-shu

@zappy-shu zappy-shu commented Jan 16, 2020 •

Copy link
Copy Markdown

Backport of #2252

- What I did

Reverses the order long-form port options when converted to short-form to correctly match the documentation and docker service create. See https://docs.docker.com/engine/reference/commandline/service_create/#publish-service-ports-externally-to-the-swarm--p---publish

Post change -p published=8111,target=8112 is the equivalent of 8111:8112

- How I did it

Changed the order of the values when converting from long to short-form when the options are parsed

- How to verify it

Build and run docker run -d --name run_test -p published=8111,target=80 nginx. nginx should be accessible from the host with port 8111

- Description for the changelog

Fixes #2250

- A picture of a cute animal (not mandatory but encouraged)

cat-2019-11-19

Reverses the order long-form port options when converted to short-form
to correctly match the documentation and `docker service create`.

Post change `-p published=8111,target=8112` is the equivalent of
`8111:8112`

Signed-off-by: Nick Adcock <nick.adcock@docker.com>
(cherry picked from commit 154a1f6)
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
@zappy-shu zappy-shu changed the title Reverse order of long-form ports [19.03 backport] Reverse order of long-form ports Jan 16, 2020
@thaJeztah thaJeztah added this to the 19.03.6 milestone Jan 16, 2020

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@silvin-lubecki silvin-lubecki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@silvin-lubecki
silvin-lubecki merged commit e6e0fa0 into docker:19.03 Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants