mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Remove the support of setting host configuration options when the container starts
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn> update Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn> update Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn> update Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
This commit is contained in:
parent
a43691d645
commit
26b6b47420
1 changed files with 2 additions and 2 deletions
|
@ -39,7 +39,7 @@ func (daemon *Daemon) ContainerStart(name string, hostConfig *containertypes.Hos
|
||||||
// This is kept for backward compatibility - hostconfig should be passed when
|
// This is kept for backward compatibility - hostconfig should be passed when
|
||||||
// creating a container, not during start.
|
// creating a container, not during start.
|
||||||
if hostConfig != nil {
|
if hostConfig != nil {
|
||||||
logrus.Warn("DEPRECATED: Setting host configuration options when the container starts is deprecated and will be removed in Docker 1.12")
|
logrus.Warn("DEPRECATED: Setting host configuration options when the container starts is deprecated and has been removed in Docker 1.12")
|
||||||
oldNetworkMode := container.HostConfig.NetworkMode
|
oldNetworkMode := container.HostConfig.NetworkMode
|
||||||
if err := daemon.setSecurityOptions(container, hostConfig); err != nil {
|
if err := daemon.setSecurityOptions(container, hostConfig); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -53,7 +53,7 @@ func (daemon *Daemon) ContainerStart(name string, hostConfig *containertypes.Hos
|
||||||
newNetworkMode := container.HostConfig.NetworkMode
|
newNetworkMode := container.HostConfig.NetworkMode
|
||||||
if string(oldNetworkMode) != string(newNetworkMode) {
|
if string(oldNetworkMode) != string(newNetworkMode) {
|
||||||
// if user has change the network mode on starting, clean up the
|
// if user has change the network mode on starting, clean up the
|
||||||
// old networks. It is a deprecated feature and will be removed in Docker 1.12
|
// old networks. It is a deprecated feature and has been removed in Docker 1.12
|
||||||
container.NetworkSettings.Networks = nil
|
container.NetworkSettings.Networks = nil
|
||||||
if err := container.ToDisk(); err != nil {
|
if err := container.ToDisk(); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Add table
Reference in a new issue