code: func (daemon *Daemon) ContainerExport(name string, out io.Writer) error {
  	container, err := daemon.GetContainer(name)
  	if err != nil {
  		return err
  	}
  
  	if runtime.GOOS == "windows" && container.OS == "windows" {
  		return fmt.Errorf("the daemon on this operating system does not support exporting Windows containers")
  	}
  
  	if container.IsDead() {
  		err := fmt.Errorf("You cannot export container %s which is Dead", container.ID)
  		return errdefs.Conflict(err)
  	}
  
  	if container.IsRemovalInProgress() {
  		err := fmt.Errorf("You cannot export container %s which is being removed", container.ID)
  		return errdefs.Conflict(err)
  	}
  
  	data, err := daemon.containerExport(container)
  	if err != nil {
  		return fmt.Errorf("Error exporting container %s: %v", name, err)
  	}
  	defer data.Close()
  
  	// Stream the entire contents of the container (basically a volatile snapshot)
  	if _, err := io.Copy(out, data); err != nil {
  		return fmt.Errorf("Error exporting container %s: %v", name, err)
  	}
  	return nil
  }
docs: // ContainerExport writes the contents of the container to the given
  // writer. An error is returned if the container cannot be found.