Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions docker/docker_image_dest.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ import (
)

type dockerImageDestination struct {
ref dockerReference
c *dockerClient
ref dockerReference
c *dockerClient
acceptUncompressedLayers bool

// State
manifestDigest digest.Digest // or "" if not yet known.
}
Expand All @@ -42,10 +44,16 @@ func newImageDestination(sys *types.SystemContext, ref dockerReference) (types.I
if err != nil {
return nil, err
}
return &dockerImageDestination{
d := &dockerImageDestination{
ref: ref,
c: c,
}, nil
}

if sys != nil {
d.acceptUncompressedLayers = sys.DockerAcceptUncompressedLayers
}

return d, nil
}

// Reference returns the reference used to set up this destination. Note that this should directly correspond to user's intent,
Expand Down Expand Up @@ -89,6 +97,9 @@ func (d *dockerImageDestination) SupportsSignatures(ctx context.Context) error {
}

func (d *dockerImageDestination) DesiredLayerCompression() types.LayerCompression {
if d.acceptUncompressedLayers {
return types.PreserveOriginal
}
return types.Compress
}

Expand Down
4 changes: 4 additions & 0 deletions types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,10 @@ type SystemContext struct {
DockerDisableV1Ping bool
// If true, dockerImageDestination.SupportedManifestMIMETypes will omit the Schema1 media types from the supported list
DockerDisableDestSchema1MIMETypes bool
// Allow uncompressed image layers in Docker images
DockerAcceptUncompressedLayers bool

// === ostree.Transport overrides ===
// Directory to use for OSTree temporary files
OSTreeTmpDirPath string

Expand Down