// ExecSync runs a command in a container synchronously.
ExecSync runs a command in a container synchronously.
// ExecSync runs a command in a container synchronously .
func (h *Runtime) ExecSync(rawContainerID string, cmd []string, timeout time.Duration) (stdout, stderr []byte, err error) {
	var (
		stdoutBuffer bytes.Buffer
		stderrBuffer bytes.Buffer
	)
	err = ensureContainerRunning(h.client, rawContainerID)
	if err != nil {
		return nil, nil, err
	}
	err = h.client.ExecInContainer(rawContainerID, cmd,
		nil, 
		ioutils.WriteCloserWrapper(&stdoutBuffer),
		ioutils.WriteCloserWrapper(&stderrBuffer),
		false, 
		nil,   
		timeout)
	return stdoutBuffer.Bytes(), stderrBuffer.Bytes(), err
}
func ( h * Runtime ) ExecSync ( rawContainerID string , cmd [ ] string , timeout time . Duration ) ( stdout , stderr [ ] byte , err error ) { var ( stdoutBuffer bytes . Buffer stderrBuffer bytes . Buffer ) err = ensureContainerRunning ( h . client , rawContainerID ) if err != nil { return nil , nil , err } err = h . client . ExecInContainer ( rawContainerID , cmd , nil , ioutils . WriteCloserWrapper ( & stdoutBuffer ) , ioutils . WriteCloserWrapper ( & stderrBuffer ) , false , nil , timeout ) return stdoutBuffer . Bytes ( ) , stderrBuffer . Bytes ( ) , err }
ExecSync runs a command in a container synchronously.
ExecSync runs a command in a container synchronously .
// check if container is running // don't need stdin here // don't need tty in ExecSync // don't need resize