Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactor code to allow mixing notation with -p
Closes #1962
Signed-off-by: Aleksander Piotrowski apiotrowski312@gmail.com
- What I did
After refactoring and bug fixing. Docker provides better error message with invalid port:
docker run --rm -p 8080:87888888 busybox
and works with mixed notation like:
docker run --rm -p 8080:80 -p published=1500,target=444 busybox
- How I did it
I changed parsePortOpts, before it was iterating over all
-p
args and assuming that all of them are in the same notation. My fix is to iterate over all args and change every with=
to short notation and then parse it.- How to verify it
docker run --rm -p 8080:80 -p published=1500,target=444 busybox
docker run --rm -p 8080:87888888 busybox
- Description for the changelog
Fix a bug with parsing
-p
flag with mixed notation- A picture of a cute animal (not mandatory but encouraged)