code: func (c *ContainerServer) ContainerStateToDisk(ctr *oci.Container) error {
  	// ignore errors, this is a best effort to have up-to-date info about
  	// a given container before its state gets stored
  	c.Runtime().UpdateContainerStatus(ctr)
  
  	jsonSource, err := ioutils.NewAtomicFileWriter(ctr.StatePath(), 0644)
  	if err != nil {
  		return err
  	}
  	defer jsonSource.Close()
  	enc := json.NewEncoder(jsonSource)
  	return enc.Encode(ctr.State())
  }
docs: // ContainerStateToDisk writes the container's state information to a JSON file
  // on disk