samalba / dockerclient

Docker client library in Go
http://www.docker.com/
Apache License 2.0
322 stars 140 forks source link

Omit 0 ShmSize from HostConfig JSON to resolve compatibility issue with Docker 1.9.1 #237

Closed hrobertson closed 8 years ago

hrobertson commented 8 years ago

In Docker 1.9.1, an SHMSize of 0 is invalid and results in an error rather than being replaced by the default value. In applications such as Drone that use dockerclient while not exposing all config values, this issue renders the application unusable with Docker 1.9.1.

In Docker >= 1.10 this is not an issue as the behaviour for an SHMSize of 0 is the same as nill (See acfd5eb). However, there are reasons for some people to be pinned to Docker 1.9.1 for the time being, eg when using Openshift.

I have not added tags to other fields as I wanted to limit the scope of this change to fixing this specific issue.

@crosbymichael, @vieux, @ehazlett

Thanks

ehazlett commented 8 years ago

lgtm

vieux commented 8 years ago

LGTM

hrobertson commented 8 years ago

Thank you 👍