fsouza/go-dockerclient

starting container with HostConfig was deprecated since v1.10 and removed in v1.12

Closed this issue · 5 comments

i got following error with Docker 1.12 RC:

FATA[0000] API error (400): {"message":"starting container with HostConfig was deprecated since v1.10 and removed in v1.12"}

according the doc Deprecated Engine Features:

HostConfig at API container start
Deprecated In Release: v1.10.0
Removed In Release: v1.12.0
Passing an HostConfig to POST /containers/{name}/start is deprecated in favor of defining it at container creation (POST /containers/create).

while the go-dockerclient still passing HostConf to StartContainer: https://github.com/fsouza/go-dockerclient/blob/master/container.go#L669

@missedone that's bad :-( Thanks for reporting. I'm thinking about keeping the parameter in go-dockerclient, but don't send it to the API, and document this behavior.

This way we wouldn't break the go-dockerclient API, and still be compatible with newer versions of Docker.

What do you think?

hi @fsouza
yes, i think so
with 2nd thought (but have not yet checked through the code), since docker remote api allow us pass the version number, if go-dockerclient support it, we can send the HostConfig only if the version < 1.12 ?

@missedone yep, we can do that and it's indeed better. I'm going to make this change.

Thanks!

Just pushed the fix, thanks for reporting!

thanks, verified on both docker engine 1.11.2 and 1.12 RC