code: func CreateID(v1Image image.V1Image, layerID layer.ChainID, parent digest.Digest) (digest.Digest, error) {
  	v1Image.ID = ""
  	v1JSON, err := json.Marshal(v1Image)
  	if err != nil {
  		return "", err
  	}
  
  	var config map[string]*json.RawMessage
  	if err := json.Unmarshal(v1JSON, &config); err != nil {
  		return "", err
  	}
  
  	// FIXME: note that this is slightly incompatible with RootFS logic
  	config["layer_id"] = rawJSON(layerID)
  	if parent != "" {
  		config["parent"] = rawJSON(parent)
  	}
  
  	configJSON, err := json.Marshal(config)
  	if err != nil {
  		return "", err
  	}
  	logrus.Debugf("CreateV1ID %s", configJSON)
  
  	return digest.FromBytes(configJSON), nil
  }
docs: // CreateID creates an ID from v1 image, layerID and parent ID.
  // Used for backwards compatibility with old clients.