containers / image

Work with containers' images
Apache License 2.0
862 stars 376 forks source link

platform.WantedPlatforms is noisy on macOS #2376

Closed rangoo94 closed 4 months ago

rangoo94 commented 6 months ago

After upgrading to v1.15.0, the Skopeo attaches an error to top line.

$ skopeo inspect --override-os linux --config docker://busybox:1.36.1
ERRO[0001] Couldn't get cpu architecture: getCPUInfo for OS darwin not implemented
{
    "created": "2023-05-18T22:34:17Z",
    "architecture": "arm64",
    "os": "linux",
    "variant": "v8",
    "config": {
        "Cmd": [
            "sh"
        ]
    },
    "rootfs": {
        "type": "layers",
        "diff_ids": [
            "sha256:3c4bc35c677d052e8ce865edea845689bf92fe12482683243d74f93fb690b893"
        ]
    },
    "history": [
        {
            "created": "2023-05-18T22:34:17Z",
            "created_by": "BusyBox 1.36.1 (glibc), Debian 12"
        }
    ]
}

Because of that, it's not possible to parse it as JSON.

TomSweeneyRedHat commented 6 months ago

@rangoo94 thanks for the report. Can you tell us what type of host you were running skopeo on please?

mtrmac commented 6 months ago

Thanks for reaching out. That warning is output to standard error, which shouldn’t impede parsing the standard output at all.

I do agree it’s probably unnecessarily noisy.

rangoo94 commented 6 months ago

Hi @TomSweeneyRedHat,

It's MacBook Pro M2 Max (Apple Silicon):

$ uname -a
Darwin DawidRusnakArm.RT-AX86U 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul  5 22:21:53 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6020 arm64

@mtrmac, thanks, I didn't notice initially that it's stderr - it will help me to handle that.

On the other side, should this issue happen at all? Based on i.e. this issue I assume it could be related to outdated client used in Skopeo.

mtrmac commented 6 months ago

No, this is not old containerd. There is some shared history but that’s no longer relevant here.

github-actions[bot] commented 5 months ago

A friendly reminder that this issue had no activity for 30 days.

mtrmac commented 4 months ago

2411 will fix this.

sedletsky-f5 commented 3 months ago

you can also add option --override-arch arm64 to avoid top-line error