Skip to content

Commit f4c893c

Browse files
committed
fix inconsistent layer compression w/ image args
previously, unpacking an image built with image_args could fail if (i think!) the FROM image's layers were uncompressed. the added layers would be compressed, and this would cause go-containerregistry to assume all of them were, leading to an 'unexpected EOF' (or 'expected tar header') error when trying to unpack the compressed layers. i think this happened because I couldn't properly return a mediatype from the registry indicating whether the layer blob was compressed or decompressed, because GetBlob didn't return that information, so maybe buildkit just trusted that it was compressed...? just a guess though. this was kind of tricky to debug. in any case, this is fixed by dropping github.com/containers/image and using go-containerregistry directly for the registry implementation. should have just used it directly in the first place tbh to avoid the dependency. much tidier now! Signed-off-by: Alex Suraci <[email protected]>
1 parent 38fb352 commit f4c893c

File tree

6 files changed

+161
-191
lines changed

6 files changed

+161
-191
lines changed

go.mod

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,17 @@ go 1.12
44

55
require (
66
github.com/BurntSushi/toml v0.3.1
7+
github.com/VividCortex/ewma v1.1.1 // indirect
78
github.com/concourse/go-archive v1.0.1
89
github.com/containerd/stargz-snapshotter/estargz v0.0.0-20210105085455-7f45f7438617 // indirect
9-
github.com/containers/image/v5 v5.9.0
1010
github.com/docker/cli v20.10.2+incompatible // indirect
1111
github.com/docker/docker v20.10.2+incompatible // indirect
1212
github.com/fatih/color v1.10.0
1313
github.com/golang/protobuf v1.4.3 // indirect
14-
github.com/google/go-cmp v0.5.2 // indirect
1514
github.com/google/go-containerregistry v0.3.0
1615
github.com/julienschmidt/httprouter v1.3.0
17-
github.com/klauspost/compress v1.11.6 // indirect
1816
github.com/onsi/gomega v1.10.3 // indirect
19-
github.com/opencontainers/go-digest v1.0.0
17+
github.com/opencontainers/image-spec v1.0.2-0.20190823105129-775207bd45b6 // indirect
2018
github.com/pkg/errors v0.9.1
2119
github.com/sirupsen/logrus v1.7.0
2220
github.com/stretchr/testify v1.6.1
@@ -27,7 +25,6 @@ require (
2725
golang.org/x/net v0.0.0-20201224014010-6772e930b67b // indirect
2826
golang.org/x/sys v0.0.0-20210108172913-0df2131ae363 // indirect
2927
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf // indirect
30-
golang.org/x/text v0.3.4 // indirect
3128
google.golang.org/protobuf v1.25.0 // indirect
3229
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect
3330
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect

0 commit comments

Comments
 (0)