mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
e41192a3f8
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
15 lines
340 B
Go
15 lines
340 B
Go
package daemon
|
|
|
|
import "fmt"
|
|
|
|
func (daemon *Daemon) ContainerRestart(name string, seconds int) error {
|
|
container, err := daemon.Get(name)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if err := container.Restart(seconds); err != nil {
|
|
return fmt.Errorf("Cannot restart container %s: %s\n", name, err)
|
|
}
|
|
container.LogEvent("restart")
|
|
return nil
|
|
}
|