8000 Reverse order of long-form ports by zappy-shu · Pull Request #2252 · docker/cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Reverse order of long-form ports #2252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

zappy-shu
Copy link
Contributor

- 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

Copy link
Contributor
@silvin-lubecki silvin-lubecki left a comment

Choose a reason for hiding this comment

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

The change looks good, but do you think we can add a test on this fix @zappy-shu ?

@thaJeztah
Copy link
Member

Looks like this was added in 29612cc, which was part of #1102

So this issue affects docker 18.09 and 19.03

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>
@zappy-shu zappy-shu force-pushed the 2250-reverse-port-long-format-order branch from c7916e4 to 154a1f6 Compare January 15, 2020 12:12
@zappy-shu
Copy link
Contributor Author

@silvin-lubecki PTAL

Copy link
Contributor
@silvin-lubecki silvin-lubecki left a comment

Choose a reason for hiding this comment

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

Still LGTM 👍

Copy link
Member
@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

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.

docker run -p with new syntax is backwards
4 participants
0