docs: def _generate_squashed_layer_path_id(self):
          """
          This function generates the id used to name the directory to
          store the squashed layer content in the archive.
  
          This mimics what Docker does here: https://github.com/docker/docker/blob/v1.10.0-rc1/image/v1/imagev1.go#L42
          To make it simpler we do reuse old image metadata and
          modify it to what it should look which means to be exact
          as https://github.com/docker/docker/blob/v1.10.0-rc1/image/v1/imagev1.go#L64
          """
  
          # Using OrderedDict, because order of JSON elements is important
          v1_metadata = OrderedDict(self.old_image_config)
  
          # Update image creation date
          v1_metadata['created'] = self.date
  
          # Remove unnecessary elements
          # Do not fail if key is not found
          for key in 'history', 'rootfs', 'container':
              v1_metadata.pop(key, None)
  
          # Docker internally changes the order of keys between
          # exported metadata (why oh why?!). We need to add 'os'
          # element after 'layer_id'
          operating_system = v1_metadata.pop('os', None)
  
          # The 'layer_id' element is the chain_id of the
          # squashed layer
          v1_metadata['layer_id'] = "sha256:%s" % self.chain_ids[-1]
  
          # Add back 'os' element
          if operating_system:
              v1_metadata['os'] = operating_system
  
          # The 'parent' element is the name of the directory (inside the
          # exported tar archive) of the last layer that we move
          # (layer below squashed layer)
  
          if self.layer_paths_to_move:
              if self.layer_paths_to_squash:
                  parent = self.layer_paths_to_move[-1]
              else:
                  parent = self.layer_paths_to_move[0]
  
              v1_metadata['parent'] = "sha256:%s" % parent
  
          # The 'Image' element is the id of the layer from which we squash
          if self.squash_id:
              # Update image id, should be one layer below squashed layer
              v1_metadata['config']['Image'] = self.squash_id
          else:
              v1_metadata['config']['Image'] = ""
  
          # Get the sha256sum of the JSON exported metadata,
          # we do not care about the metadata anymore
          sha = self._dump_json(v1_metadata)[1]
  
          return sha