Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 0.76.0 release of syft container image is requiring matching architecture #1708

Closed
mthalman opened this issue Apr 3, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@mthalman
Copy link

mthalman commented Apr 3, 2023

What happened:

I'm using the syft container image to run commands. A breaking change occurred between 0.75.0 and 0.76.0 that causes the target image to match the architecture of the environment (syft container).

It results in the following error message:

[0001]  WARN scheme "docker" specified, but it coincides with a common image name; re-examining user input "docker:mcr.microsoft.com/dotnet/runtime-deps:8.0-preview-jammy-chiseled-arm32v7" without scheme parsing because image retrieval using scheme parsing was unsuccessful: unable to use DockerDaemon source: image has unexpected architecture "arm", which differs from the user specified architecture "arm64"
2023/04/03 21:12:08 error during command execution: 1 error occurred:
        * failed to construct source from user input "docker:mcr.microsoft.com/dotnet/runtime-deps:8.0-preview-jammy-chiseled-arm32v7": could not fetch image "mcr.microsoft.com/dotnet/runtime-deps:8.0-preview-jammy-chiseled-arm32v7": unable to determine image source to select platform

What you expected to happen:

Command should successfully return the packages contained in the target image.

Steps to reproduce the issue:

From a Windows 11 x64 machine with Docker Desktop installed, run:

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock  anchore/syft:v0.76.0 packages docker:mcr.microsoft.com/dotnet/runtime-deps:8.0-preview-jammy-chiseled-arm32v7 -o json

This executes successfully if you target the v0.75.0 tag.

This works correctly if you match the architecture with the --platform tag (notice in this example that I'm targeting Arm64 instead of Arm32):

docker run --platform linux/arm64 --rm -v /var/run/docker.sock:/var/run/docker.sock  anchore/syft:v0.76.0 packages docker:mcr.microsoft.com/dotnet/runtime-deps:8.0-preview-jammy-chiseled-arm64v8 -o json

But this isn't possible to do with Arm32 (with emulation) because there are no Arm32 syft container images published.

@tgerla
Copy link
Contributor

tgerla commented Apr 6, 2023

Hi @mthalman, thanks for the report, and sorry for the trouble. The change that is affecting you is: anchore/stereoscope#152 -- it looks like in your example you're adding the "--platform linux/arm64" argument to the docker command. Can you try instead to remove the docker --platform argument and instead specify it as a syft argument like this:

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock  anchore/syft:v0.76.0 packages docker:mcr.microsoft.com/dotnet/runtime-deps:8.0-preview-jammy-chiseled-arm64v8 -o json --platform linux/arm64

Can you give that a try and let us know how it goes? Thanks!

@tgerla tgerla moved this to Awaiting Response in OSS Apr 6, 2023
@mthalman
Copy link
Author

mthalman commented Apr 6, 2023

Ah, thanks! Specifying the --platform option as an argument to syft resolves the issue.

@tgerla
Copy link
Contributor

tgerla commented Apr 6, 2023

Great! Thanks for the update.

@tgerla tgerla closed this as not planned Won't fix, can't repro, duplicate, stale Apr 6, 2023
@github-project-automation github-project-automation bot moved this from Awaiting Response to Done in OSS Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants