-
Notifications
You must be signed in to change notification settings - Fork 2k
fixes "docker port <id> portrange" #1396
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
base: master
Are you sure you want to change the base?
Conversation
I also think that the message "Error: No public port '6376-6379/tcp' published for redis2" is a bug, because it have public port for them. |
docker port <id> ports-porte
Codecov Report
@@ Coverage Diff @@
## master #1396 +/- ##
==========================================
+ Coverage 54.31% 54.37% +0.06%
==========================================
Files 289 289
Lines 19318 19274 -44
==========================================
- Hits 10492 10481 -11
+ Misses 8148 8121 -27
+ Partials 678 672 -6 |
Signed-off-by: Lifubang <lifubang@acmcoder.com>
@kolyshkin If you have a time, please take a look this one. |
Or disable port range in |
fmt.Fprintf(dockerCli.Out(), "%s -> %s:%s\n", nowP, frontend.HostIP, frontend.HostPort) | ||
} | ||
} else { | ||
fmt.Fprintf(dockerCli.Out(), "Error: No public port '%s' published for %s\n", nowP, opts.container) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
return errors.Errorf("no public port %q published for %s", nowP, opts.container)
?
portStart, portEnd, _ := nat.ParsePortRange(port) | ||
if portEnd > portStart { | ||
for nport := portStart; nport <= portEnd; nport++ { | ||
nowP, _ := nat.NewPort(proto, fmt.Sprint(nport)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strconv.Itoa(nport)
?
|
Signed-off-by: Lifubang lifubang@acmcoder.com
- What I did
I have a container redis2:
When run
docker port redis2 6376-6379
, it alway said:Because in most of time, there are no port range key in ports of docker inspect result .
So, I think we can get the port info separately.
- How I did it
Don't return an error when '6376-6379/tcp' not found.
then use portStart, portEnd, err := nat.ParsePortRangeToInt(port)
then print port info from portStart to portEnd
- How to verify it
- Description for the changelog
Make port range in docker port can work.
- A picture of a cute animal
