Open Lachlan-White opened 4 months ago
Nice catch @Lachlan-White
It looks like our current .goreleaser.yaml
doesn't account for a v7
distribution here.
This section does not exist in our release file:
# GOARM to build for when GOARCH is arm.
# For more info refer to: https://go.dev/doc/install/source#environment
#
# Default: [ 6 ]
goarm:
- 6
- 7
Reading again, it also looks like we only support arm64
as a release candidate: ARM64 (64-bit): Also known as ARMv8
- id: linux-build
dir: ./cmd/syft
binary: syft
goos:
- linux
goarch:
- amd64
- arm64
- ppc64le
- s390x
To reproduce this I also ran
❯ docker run -it mcr.microsoft.com/powershell:latest /bin/sh
# uname -m
x86_64
It looks like for the powershell latest docker image the arch should be x86_64) arch="amd64" ;;
I was also able to install syft successfully when running that image interactively:
# curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin
[info] fetching release script for tag='v1.4.1'
[info] using release tag='v1.4.1' version='1.4.1' os='linux' arch='amd64'
[info] installed /usr/local/bin/syft
Do you have any more information on why your mcr.microsoft.com/powershell:latest /bin/sh
is returning an arm32
architecture?
I can talk with the team about updating our release assets, but want to also get to the bottom of why we're seeing different outcomes on our respective machine.
Here is the link to the powershell official docker image along with the tags and their supported architecture: https://hub.docker.com/_/microsoft-powershell
Hey @spiffcs, thanks for the quick response!
Have no idea why the default output of the Microsoft image is returning an arm32
by default.
I might just force the version specifically in arm64
which would fix my issue, but it is an interesting scenario.
If you had anything you wanted me to test on my local to help, just let me know
If you run this on your local what's your result?
docker run -it mcr.microsoft.com/powershell:latest /bin/sh
# uname -a
Linux 83b1dbc1234f 6.6.26-linuxkit #1 SMP PREEMPT_DYNAMIC Sat Apr 27 04:15:35 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
I copied your Dockerfile and removed the powershell lines and was able to get a successful install.
What happens if you do the same for the alpine version or any explicitly tagged x86_64
arch?
docker run -it mcr.microsoft.com/powershell:lts-alpine-3.17 /bin/sh
Unable to find image 'mcr.microsoft.com/powershell:lts-alpine-3.17' locally
lts-alpine-3.17: Pulling from powershell
3c854c8cbf46: Pull complete
09b3f3175f8c: Pull complete
0505aeb2a439: Pull complete
Digest: sha256:2064d42be1cb05f5d83995f2b12f95737fe74924cbd8519fda886ad834e0b4f8
Status: Downloaded newer image for mcr.microsoft.com/powershell:lts-alpine-3.17
/ # uname -a
Linux aab7448f7e05 6.6.26-linuxkit #1 SMP PREEMPT_DYNAMIC Sat Apr 27 04:15:35 UTC 2024 x86_64 Linux
What happened: Attempting to build docker image leveraging install script for syft.
What you expected to happen: Syft to be installed
Steps to reproduce the issue:
Anything else we need to know?: Error Message:
Environment:
syft version
:cat /etc/os-release
or similar): Mac M1 running Ubuntu Image for container.