containers / toolbox

Tool for interactive command line environments on Linux
https://containertoolbx.org/
Apache License 2.0
2.39k stars 208 forks source link

Toolbox always shows the image size as 500MB #1388

Closed RoguedBear closed 8 months ago

RoguedBear commented 8 months ago

Is your feature request related to a problem? Please describe. whenever toolbox prompts to download a new image, it always shows the image size to be 500MB

Describe the solution you'd like Display the correct image size before pulling by getting the data from image manifest and summing all the layer sizes

example manifest
docker manifest inspect docker.io/scottyhardy/docker-wine@sha256:2fbf4eb8728c755d36dc87d7d85aa84d292153932abc20b2de5b7900456ca3c2
{
    "schemaVersion": 2,
    "mediaType": "application/vnd.oci.image.manifest.v1+json",
    "config": {
        "mediaType": "application/vnd.oci.image.config.v1+json",
        "digest": "sha256:ca0811315cacc2d58a60d657252f338a32bbf9c70f388cc62b18fe93c42b2452",
        "size": 6833
    },
    "layers": [
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:96d54c3075c9eeaed5561fd620828fd6bb5d80ecae7cb25f9ba5f7d88ea6e15c",
            "size": 27505999
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:82ac931c21377a100d477381135bc27a17b97c47af6bbc97d42b73bc66c070c9",
            "size": 274526673
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:6e2354fed286aa3a62ee23f68db34cfcccef6ce45bed824c94507800ebefec94",
            "size": 863689
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:63b8246de33784dd4db2642a24279b1b3a38dcad7d7d431c7ec29789c466b94b",
            "size": 75211
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:54e92c175d21513822d90ac3e46c2d8467476adf82a3e98d3c5fb5d6549fe4d4",
            "size": 396
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:eb27d12d764cb1315918561b363ca1823c578627339cad40552be83b07c231f5",
            "size": 64743656
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:cd9d4b152246a8cf0fbab354d181aa7da5035d239bfd670452059faa4ec26acf",
            "size": 579549959
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:816ce146cd41ba6be8dcd37391cf76b59ddfa193ffdfc8b2e0aa74251adad00b",
            "size": 172532
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:ba1dcca341e22216859ca0b4ac41471af60b34fbea4db19dc068b8b024ad3dd8",
            "size": 830
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:17b28806b74b6fd14d83e29fdcada3ae4e2d3461bf77252144822fe131026af4",
            "size": 196779400
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:c0f5816b810f7d88ecb2649a2a04885854e6f68eb3d1ff608cc172ba07f52fe7",
            "size": 863476
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:3d2206de0a81af41c168ad058e34e3909a3f8beb3d528b73331b1b1271ff1eb5",
            "size": 328
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:b945e83e2bb36dc25d56689fb565787b88a64df6abc6f773d16b11d1e5f0c7a3",
            "size": 1898
        }
    ]
}

Describe alternatives you've considered NA

Additional context


I would also be willing to contribute, if this request is considered tangible enough to be added.

juhp commented 8 months ago

See #752

RoguedBear commented 8 months ago

I will close my issue as duplicate. However going through create.go, I should be seeing one of these output: image name with size, or image name https://github.com/containers/toolbox/blob/cb4e5dd52dbf2b65377b3bd7eb16100e294e7214/src/cmd/create.go#L718-L723

however i still get the image size to be 500MB image image

toolbox version:

└$ toolbox --version
toolbox version 0.0.99.2
juhp commented 8 months ago

The latest current release is 0.0.99.4 though I also see 500MB

RoguedBear commented 8 months ago

ubuntu still shows the version to be 0.99.2.

I do not have skopeo installed right now, but according to the PR that closes the issue, i should see the text without the image size. I am not sure if the current output is intended or a bug

juhp commented 8 months ago

According to https://bugzilla.redhat.com/show_bug.cgi?id=2245066#c1 this is fixed already in git but not released yet unfortunately.

RoguedBear commented 8 months ago

i see. i'll be closing the issue then

juhp commented 8 months ago

Will there a new release soon? (or even 0.1?)

debarshiray commented 7 months ago

Will there a new release soon? (or even 0.1?)

Soon. We need to sort this out before making a release: https://github.com/containers/toolbox/pull/1274