google / crfs

CRFS: Container Registry Filesystem

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

stargzify: stargzifying an image twice results in a broken image

ktock opened this issue · comments

It is possible for an image to be stargzified twice during the distribution lifecycle, which currently results in a broken image.

Following is OK:

$ stargzify -insecure ubuntu:18.04 http://private:5000/ubuntu:once
$ docker pull private:5000/ubuntu:once

But when we stargzify twice, it results in a broken image:

$ stargzify -insecure http://private:5000/ubuntu:once http://private:5000/ubuntu:twice
$ docker pull private:5000/ubuntu:twice
failed to register layer: Error processing tar file(duplicates of file paths not supported): 

The reason is the name of TOC JSON file("stargz.index.json") isn't reserved and duplicates in the stargzified image.

$ curl http://private:5000/v2/ubuntu/blobs/sha256:479846a1cefdb8af9ace78046a2e3a691ccbf8b018b710cb9fcea7fe0593dd97 | tar -z --list
run/
run/systemd/
run/systemd/container
stargz.index.json
stargz.index.json