code: func MakeConfigFromV1Config(imageJSON []byte, rootfs *image.RootFS, history []image.History) ([]byte, error) {
  	var dver struct {
  		DockerVersion string `json:"docker_version"`
  	}
  
  	if err := json.Unmarshal(imageJSON, &dver); err != nil {
  		return nil, err
  	}
  
  	useFallback := versions.LessThan(dver.DockerVersion, noFallbackMinVersion)
  
  	if useFallback {
  		var v1Image image.V1Image
  		err := json.Unmarshal(imageJSON, &v1Image)
  		if err != nil {
  			return nil, err
  		}
  		imageJSON, err = json.Marshal(v1Image)
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	var c map[string]*json.RawMessage
  	if err := json.Unmarshal(imageJSON, &c); err != nil {
  		return nil, err
  	}
  
  	delete(c, "id")
  	delete(c, "parent")
  	delete(c, "Size") // Size is calculated from data on disk and is inconsistent
  	delete(c, "parent_id")
  	delete(c, "layer_id")
  	delete(c, "throwaway")
  
  	c["rootfs"] = rawJSON(rootfs)
  	c["history"] = rawJSON(history)
  
  	return json.Marshal(c)
  }
docs: // MakeConfigFromV1Config creates an image config from the legacy V1 config format.