mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
PublishAllPorts: don't crash with nil PortBindings
Introduced by commit 85b260f ("PublishAllPorts: create
port mappings for exposed ports").
Signed-off-by: Rob Murray <rob.murray@docker.com>
This commit is contained in:
@@ -42,6 +42,9 @@ func decodeCreateRequest(src io.Reader) (container.CreateRequest, error) {
|
||||
if w.HostConfig == nil {
|
||||
w.HostConfig = &container.HostConfig{}
|
||||
}
|
||||
if w.HostConfig.PortBindings == nil {
|
||||
w.HostConfig.PortBindings = make(network.PortMap)
|
||||
}
|
||||
// Make sure NetworkMode has an acceptable value. We do this to ensure
|
||||
// backwards compatible API behavior.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user