code: func (container *Container) InitializeStdio(iop *cio.DirectIO) (cio.IO, error) {
  	if err := container.startLogging(); err != nil {
  		container.Reset(false)
  		return nil, err
  	}
  
  	container.StreamConfig.CopyToPipe(iop)
  
  	if container.StreamConfig.Stdin() == nil && !container.Config.Tty {
  		if iop.Stdin != nil {
  			if err := iop.Stdin.Close(); err != nil {
  				logrus.Warnf("error closing stdin: %+v", err)
  			}
  		}
  	}
  
  	return &rio{IO: iop, sc: container.StreamConfig}, nil
  }
docs: // InitializeStdio is called by libcontainerd to connect the stdio.