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 <suraci.alex@gmail.com>
1 parent 38fb352 commit f4c893c

File tree

6 files changed

+161
-191
lines changed

6 files changed

+161
-191
lines changed

go.mod

Lines changed: 2 additions & 5 deletions
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)