mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
daemon: disallow container port 0
Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com>
This commit is contained in:
@@ -335,7 +335,7 @@ func validateHealthCheck(healthConfig *containertypes.HealthConfig) error {
|
||||
|
||||
func validatePortBindings(ports networktypes.PortMap) error {
|
||||
for port := range ports {
|
||||
if !port.IsValid() {
|
||||
if !port.IsValid() || port.Num() == 0 {
|
||||
return errors.Errorf("invalid port specification: %q", port.String())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user