allow skipping empty layer detection on cache export
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 29af1397e2
)
Signed-off-by: Tibor Vass <tibor@docker.com>
v0.8
parent
edd0a756a3
commit
3a270318fc
|
@ -10,6 +10,10 @@ import (
|
|||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// EmptyLayerRemovalSupported defines if implementation supports removal of empty layers. Buildkit image exporter
|
||||
// removes empty layers, but moby layerstore based implementation does not.
|
||||
var EmptyLayerRemovalSupported = true
|
||||
|
||||
// sortConfig sorts the config structure to make sure it is deterministic
|
||||
func sortConfig(cc *CacheConfig) {
|
||||
type indexedLayer struct {
|
||||
|
@ -239,7 +243,7 @@ func marshalRemote(r *solver.Remote, state *marshalState) string {
|
|||
}
|
||||
desc := r.Descriptors[len(r.Descriptors)-1]
|
||||
|
||||
if desc.Digest == exptypes.EmptyGZLayer {
|
||||
if desc.Digest == exptypes.EmptyGZLayer && EmptyLayerRemovalSupported {
|
||||
return parentID
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue