mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-16 15:10:12 +01:00
Pass in HostConfig to create operation
This commit is contained in:
parent
2c0a9fa3d2
commit
adac33bf4a
1 changed files with 4 additions and 4 deletions
|
|
@ -106,19 +106,19 @@ func (client dockerClient) StopContainer(c Container, timeout time.Duration) err
|
||||||
|
|
||||||
func (client dockerClient) StartContainer(c Container) error {
|
func (client dockerClient) StartContainer(c Container) error {
|
||||||
config := c.runtimeConfig()
|
config := c.runtimeConfig()
|
||||||
hostConfig := c.hostConfig()
|
config.HostConfig = *c.hostConfig()
|
||||||
name := c.Name()
|
name := c.Name()
|
||||||
|
|
||||||
log.Infof("Starting %s", name)
|
log.Infof("Starting %s", name)
|
||||||
|
|
||||||
newContainerID, err := client.api.CreateContainer(config, name)
|
newContainerID, err := client.api.CreateContainer(config, name, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Debugf("Starting container %s (%s)", name, newContainerID)
|
log.Debugf("Starting container %s (%s)", name, newContainerID)
|
||||||
|
|
||||||
return client.api.StartContainer(newContainerID, hostConfig)
|
return client.api.StartContainer(newContainerID, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (client dockerClient) RenameContainer(c Container, newName string) error {
|
func (client dockerClient) RenameContainer(c Container, newName string) error {
|
||||||
|
|
@ -153,7 +153,7 @@ func (client dockerClient) IsContainerStale(c Container) (bool, error) {
|
||||||
func (client dockerClient) RemoveImage(c Container) error {
|
func (client dockerClient) RemoveImage(c Container) error {
|
||||||
imageID := c.ImageID()
|
imageID := c.ImageID()
|
||||||
log.Infof("Removing image %s", imageID)
|
log.Infof("Removing image %s", imageID)
|
||||||
_, err := client.api.RemoveImage(imageID)
|
_, err := client.api.RemoveImage(imageID, false)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue