Skip to content

image: align erofs raw/zstd convert behavior with containerd#4927

Open
ChengyuZhu6 wants to merge 1 commit into
containerd:mainfrom
ChengyuZhu6:erofs
Open

image: align erofs raw/zstd convert behavior with containerd#4927
ChengyuZhu6 wants to merge 1 commit into
containerd:mainfrom
ChengyuZhu6:erofs

Conversation

@ChengyuZhu6

Copy link
Copy Markdown
Member

Fixes: #4861

@ChengyuZhu6 ChengyuZhu6 marked this pull request as draft May 22, 2026 02:49
Comment thread cmd/nerdctl/image/image_convert_linux_test.go Outdated
@ChengyuZhu6 ChengyuZhu6 force-pushed the erofs branch 2 times, most recently from 45e749b to d5a41d0 Compare May 22, 2026 09:30
Comment thread go.mod
@ChengyuZhu6 ChengyuZhu6 added this to the v2.3.2 milestone May 22, 2026
@ChengyuZhu6 ChengyuZhu6 force-pushed the erofs branch 2 times, most recently from d597639 to 1e2babc Compare May 22, 2026 09:39
@ChengyuZhu6 ChengyuZhu6 requested a review from sathiraumesh May 22, 2026 09:49
@sathiraumesh

Copy link
Copy Markdown
Contributor

if there are no others it looks okay to me

@AkihiroSuda AkihiroSuda removed this from the v2.3.2 milestone Jun 11, 2026
@ChengyuZhu6 ChengyuZhu6 force-pushed the erofs branch 8 times, most recently from 8d9de47 to b85a0ea Compare June 21, 2026 13:43
@ChengyuZhu6 ChengyuZhu6 added this to the v2.3.4 milestone Jun 21, 2026
Add raw and zstd EROFS conversion support with containerd's EROFS converter.
Fixes: containerd#4861

Signed-off-by: Chengyu Zhu <hudson@cyzhu.com>
@ChengyuZhu6

Copy link
Copy Markdown
Member Author
# nerdctl image convert --erofs zstd env12.com/library/ubuntu:20.04 env12.com/library/ubuntu:20.04-erofs-0621-zstd
WARN[0000] option --erofs should be used in conjunction with --oci 
env12.com/library/ubuntu:20.04-erofs-0621-zstd:                                   resolved     env12.com/library/ubuntu:20.04-erofs-0621-zstd:                                   resolved       |++++++++++++++++++++++++++++++++++++++| index-sha256:121726370cec48ffa4fc006c3f75d5cd0835b6b97586119023a7068e7906d0b7:    exists         |++++++++++++++++++++++++++++++++++++++| manifest-sha256:c664f8f86ed5a386b0a340d981b8f81714e21a8b9c73f658c4bea56aa179d54a: exists         |++++++++++++++++++++++++++++++++++++++| config-sha256:b7bab04fd9aa0c771e5720bf0cc7cbf993fd6946645983d9096126e5af45d713:   exists         |++++++++++++++++++++++++++++++++++++++| layer-sha256:13b7e930469f6d3575a320709035c6acf6f5485a76abcf03d1b92a64c09c2476:    exists         |++++++++++++++++++++++++++++++++++++++| elapsed: 2.9 s                                                                    total:   0.0 B (0.0 B/s)
# nerdctl push env12.com/library/ubuntu:20.04-erofs-0621-zstdINFO[0000] pushing as a reduced-platform image (application/vnd.oci.image.index.v1+json, sha256:6d253ab5bee747c31e242be763d43a8fae579f66d45ef4fe9e981059bdbd0e0a) 
index-sha256:6d253ab5bee747c31e242be763d43a8fae579f66d45ef4fe9e981059bdbd0e0a:    done           |++++++++++++++++++++++++++++++++++++++| 
manifest-sha256:bbff53e6a6c1e7fa4f9a937721d80a530f7fab85e2c1b9c013b1de1432bf4ea7: done           |++++++++++++++++++++++++++++++++++++++| 
layer-sha256:be3e928c0084a1279b86d771cd8c9d75a9d7e90295131c3757388c6bac9c4084:    done           |++++++++++++++++++++++++++++++++++++++| 
config-sha256:5824adab6cbce42ae826a50d419493c49447f9c827d83e24eec2138c3b620c7f:   done           |++++++++++++++++++++++++++++++++++++++| 
elapsed: 4.3 s                                                                    total:  23.2 M (5.4 MiB/s)
                                         
# nerdctl image convert --erofs raw env12.com/library/ubuntu:20.04 env12.com/library/ubuntu:20.04-erofs-0621
WARN[0000] option --erofs should be used in conjunction with --oci 
env12.com/library/ubuntu:20.04-erofs-0621:                                        resolved     env12.com/library/ubuntu:20.04-erofs-0621:                                        resolved       |++++++++++++++++++++++++++++++++++++++| index-sha256:121726370cec48ffa4fc006c3f75d5cd0835b6b97586119023a7068e7906d0b7:    exists         |++++++++++++++++++++++++++++++++++++++| manifest-sha256:c664f8f86ed5a386b0a340d981b8f81714e21a8b9c73f658c4bea56aa179d54a: exists         |++++++++++++++++++++++++++++++++++++++| config-sha256:b7bab04fd9aa0c771e5720bf0cc7cbf993fd6946645983d9096126e5af45d713:   exists         |++++++++++++++++++++++++++++++++++++++| layer-sha256:13b7e930469f6d3575a320709035c6acf6f5485a76abcf03d1b92a64c09c2476:    exists         |++++++++++++++++++++++++++++++++++++++| elapsed: 3.2 s                                                                    total:   0.0 B (0.0 B/s)
# nerdctl push env12.com/library/ubuntu:20.04-erofs-0621INFO[0000] pushing as a reduced-platform image (application/vnd.oci.image.index.v1+json, sha256:46e3aed7bc082f2386106b7b3ac50089457840ab8717277941cfe94e32f96bdd) 
index-sha256:46e3aed7bc082f2386106b7b3ac50089457840ab8717277941cfe94e32f96bdd:    done           |++++++++++++++++++++++++++++++++++++++| 
manifest-sha256:7cfe388d681e8e39f44b025387f53fafc6bef12a95fda9561755d915347276ba: done           |++++++++++++++++++++++++++++++++++++++| 
layer-sha256:34c9cce61ef84e29d092a45e64069667c7e3542e8481d4fe8725bb774bcd6167:    done           |++++++++++++++++++++++++++++++++++++++| 
config-sha256:62184158ea39ddb98ae7df5c55ad73df8a0a9f6110f594db0bbe01b1224ee560:   done           |++++++++++++++++++++++++++++++++++++++| 
elapsed: 8.0 s                                                                    total:  75.9 M (9.5 MiB/s)   

@ChengyuZhu6

Copy link
Copy Markdown
Member Author
# nerdctl manifest inspect env12.com/library/ubuntu:20.04-erofs-0621-zstd
{
    "schemaVersion": 2,
    "mediaType": "application/vnd.oci.image.index.v1+json",
    "manifests": [
        {
            "mediaType": "application/vnd.oci.image.manifest.v1+json",
            "digest": "sha256:bbff53e6a6c1e7fa4f9a937721d80a530f7fab85e2c1b9c013b1de1432bf4ea7",
            "size": 399,
            "annotations": {
                "com.docker.official-images.bashbrew.arch": "amd64",
                "org.opencontainers.image.base.name": "scratch",
                "org.opencontainers.image.created": "2025-04-04T00:00:00Z",
                "org.opencontainers.image.revision": "fb4da0956290c3b216a35315510f66ca9bc4a460",
                "org.opencontainers.image.source": "https://git.launchpad.net/cloud-images/+oci/ubuntu-base",
                "org.opencontainers.image.url": "https://hub.docker.com/_/ubuntu",
                "org.opencontainers.image.version": "20.04"
            },
            "platform": {
                "architecture": "amd64",
                "os": "linux",
                "os.features": [
                    "erofs"
                ]
            }
        }
    ]
}
# nerdctl manifest inspect env12.com/library/ubuntu@sha256:bbff53e6a6c1e7fa4f9a937721d80a530f7fab85e2c1b9c013b1de1432bf4ea7
{
    "schemaVersion": 2,
    "mediaType": "application/vnd.oci.image.manifest.v1+json",
    "config": {
        "mediaType": "application/vnd.oci.image.config.v1+json",
        "digest": "sha256:5824adab6cbce42ae826a50d419493c49447f9c827d83e24eec2138c3b620c7f",
        "size": 2029
    },
    "layers": [
        {
            "mediaType": "application/vnd.erofs.layer.v1+zstd",
            "digest": "sha256:be3e928c0084a1279b86d771cd8c9d75a9d7e90295131c3757388c6bac9c4084",
            "size": 24365791
        }
    ]
}

# nerdctl manifest inspect env12.com/library/ubuntu:20.04-erofs-0621
{
    "schemaVersion": 2,
    "mediaType": "application/vnd.oci.image.index.v1+json",
    "manifests": [
        {
            "mediaType": "application/vnd.oci.image.manifest.v1+json",
            "digest": "sha256:7cfe388d681e8e39f44b025387f53fafc6bef12a95fda9561755d915347276ba",
            "size": 394,
            "annotations": {
                "com.docker.official-images.bashbrew.arch": "amd64",
                "org.opencontainers.image.base.name": "scratch",
                "org.opencontainers.image.created": "2025-04-04T00:00:00Z",
                "org.opencontainers.image.revision": "fb4da0956290c3b216a35315510f66ca9bc4a460",
                "org.opencontainers.image.source": "https://git.launchpad.net/cloud-images/+oci/ubuntu-base",
                "org.opencontainers.image.url": "https://hub.docker.com/_/ubuntu",
                "org.opencontainers.image.version": "20.04"
            },
            "platform": {
                "architecture": "amd64",
                "os": "linux",
                "os.features": [
                    "erofs"
                ]
            }
        }
    ]
}
# nerdctl manifest inspect env12.com/library/ubuntu@sha256:7cfe388d681e8e39f44b025387f53fafc6bef12a95fda9561755d915347276ba
{
    "schemaVersion": 2,
    "mediaType": "application/vnd.oci.image.manifest.v1+json",
    "config": {
        "mediaType": "application/vnd.oci.image.config.v1+json",
        "digest": "sha256:62184158ea39ddb98ae7df5c55ad73df8a0a9f6110f594db0bbe01b1224ee560",
        "size": 2029
    },
    "layers": [
        {
            "mediaType": "application/vnd.erofs.layer.v1",
            "digest": "sha256:34c9cce61ef84e29d092a45e64069667c7e3542e8481d4fe8725bb774bcd6167",
            "size": 79568896
        }
    ]
}

@ChengyuZhu6

ChengyuZhu6 commented Jun 21, 2026

Copy link
Copy Markdown
Member Author
# nerdctl image pull --snapshotter erofs  env12.com/library/ubuntu:20.04-erofs-0621
env12.com/library/ubuntu:20.04-erofs-0621       saved
└──index-sha256:46e3aed7bc082f2386106b7b        complete        |++++++++++++++++++++++++++++++++++++++|
   └──manifest-sha256:7cfe388d681e8e39f4        complete        |++++++++++++++++++++++++++++++++++++++|
      ├──config-sha256:62184158ea39ddb98        complete        |++++++++++++++++++++++++++++++++++++++|
      └──layer-sha256:34c9cce61ef84e29d0        complete        |++++++++++++++++++++++++++++++++++++++|
application/vnd.oci.image.index.v1+json sha256:46e3aed7bc082f2386106b7b3ac50089457840ab8717277941cfe94e32f96bdd
Completed pull from OCI Registry (env12.com/library/ubuntu:20.04-erofs-0621)    elapsed: 7.6 stotal:  75.9 M   (10.0 MiB/s)

# nerdctl image pull --snapshotter erofs  env12.com/library/ubuntu:20.04-erofs-0621-zstd
env12.com/library/ubuntu:20.04-erofs-0621-zstd  saved
└──index-sha256:6d253ab5bee747c31e242be7        complete        |++++++++++++++++++++++++++++++++++++++|
   └──manifest-sha256:bbff53e6a6c1e7fa4f        complete        |++++++++++++++++++++++++++++++++++++++|
      ├──config-sha256:5824adab6cbce42ae        complete        |++++++++++++++++++++++++++++++++++++++|
      └──layer-sha256:be3e928c0084a1279b        complete        |++++++++++++++++++++++++++++++++++++++|
application/vnd.oci.image.index.v1+json sha256:6d253ab5bee747c31e242be763d43a8fae579f66d45ef4fe9e981059bdbd0e0a
Completed pull from OCI Registry (env12.com/library/ubuntu:20.04-erofs-0621-zstd)       elapsed: 3.7 s total:  23.2 M  (6.3 MiB/s)

@ChengyuZhu6 ChengyuZhu6 marked this pull request as ready for review June 21, 2026 14:00
@ChengyuZhu6 ChengyuZhu6 requested review from a team, dmcgowan and hsiangkao and removed request for sathiraumesh June 21, 2026 14:00
@AkihiroSuda AkihiroSuda requested a review from ktock June 22, 2026 04:35
@ChengyuZhu6 ChengyuZhu6 modified the milestones: v2.3.4, v2.4.0 Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support to convert erofs image

3 participants