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
Port out of bounds gives error 'invalid publish opts format' #1962
Comments
Thanks for reporting; I see where the problem is, but it looks like it needs some refactoring; The current code first attempts to parse the cli/cli/command/container/opts.go Lines 384 to 387 in 2432af7
If that parsing fails, it assumes it's because the user used the advanced/long-hand notation ( cli/cli/command/container/opts.go Lines 785 to 788 in 2432af7
And then it returns that error ("should be name=value"). I see that the current logic has another problem; because all options are parsed either as shorthand or as longhand, you cannot combine the shorthand and longhand form, so this also fails currently: In this case, both options are valid, but don't work when combined; # valid
docker run --rm -p 8080:80 busybox
# also valid
docker run --rm -p target=8081,published=81 busybox
# produces an error:
docker run --rm -p 8080:80 -p target=8081,published=81 busybox
docker: invalid publish opts format (should be name=value but got '8080:80'). So, what I think is needed is:
|
The instructions stopped working because docker messed up its command line parsing: <docker/cli#1962> Besides, lektor doesn't like backslashes in code blocks.
Is this still an issue? |
🤦♂️ |
I still get this problem. Today I tried: docker run --name redisinsight_rci -p 80010:8001 -dit -v redisinsight:/db redislabs/redisinsight So I was forced to use another port, in this case, 8100:8001 |
@lflucasferreira the fix is only in master currently, but port |
This problem is still extant. Running Gives docker: It also occurs if I use -p instead of --publish= |
@DevinCampbell #2251 is not in a 19.03.x release, and will be in the upcoming 20.x release |
Actually, looks like your issue is in docker create -p 7359/udp:7359/udp nginx:alpine
docker: invalid publish opts format (should be name=value but got '7359/udp:7359/udp').
See 'docker create --help'. |
Description
When run with a port out of bounds throws wrong error saying about options format instead of say port does not exist, or something related.
Steps to reproduce the issue:
docker run -it -p 80801:80 --rm nginx:1.17.0-alpine /bin/sh
Describe the results you received:
docker: invalid publish opts format (should be name=value but got '80801:80').
See 'docker run --help'.
Describe the results you expected:
docker: invalid port '80801:80'.
Additional information you deem important (e.g. issue happens only occasionally):
first time happens.
if run
docker run -it -p 10801:80 --rm nginx:1.17.0-alpine /bin/sh
. works!invalid publish opts format (should be name=value but got '80801:80').
has nothing to do with the problem.Output of
docker version
:Output of
docker info
:The text was updated successfully, but these errors were encountered: