6 "github.com/docker/docker/libcontainerd"
9 // ContainerResize changes the size of the TTY of the process running
10 // in the container with the given name to the given height and width.
11 func (daemon *Daemon) ContainerResize(name string, height, width int) error {
12 container, err := daemon.GetContainer(name)
17 if !container.IsRunning() {
18 return errNotRunning{container.ID}
21 if err = daemon.containerd.Resize(container.ID, libcontainerd.InitFriendlyName, width, height); err == nil {
22 attributes := map[string]string{
23 "height": fmt.Sprintf("%d", height),
24 "width": fmt.Sprintf("%d", width),
26 daemon.LogContainerEventWithAttributes(container, "resize", attributes)
31 // ContainerExecResize changes the size of the TTY of the process
32 // running in the exec with the given name to the given height and
34 func (daemon *Daemon) ContainerExecResize(name string, height, width int) error {
35 ec, err := daemon.getExecConfig(name)
39 return daemon.containerd.Resize(ec.ContainerID, ec.ID, width, height)