github.com/sevki/docker@v1.7.1/daemon/pause.go (about) 1 package daemon 2 3 import "fmt" 4 5 // ContainerPause pauses a container 6 func (daemon *Daemon) ContainerPause(name string) error { 7 container, err := daemon.Get(name) 8 if err != nil { 9 return err 10 } 11 12 if err := container.Pause(); err != nil { 13 return fmt.Errorf("Cannot pause container %s: %s", name, err) 14 } 15 container.LogEvent("pause") 16 17 return nil 18 }