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

Support Arm64 #5070

Open
1 task done
denisa opened this issue Dec 26, 2023 · 21 comments · May be fixed by #5320
Open
1 task done

Support Arm64 #5070

denisa opened this issue Dec 26, 2023 · 21 comments · May be fixed by #5320
Labels
enhancement New feature or request O: backlog 🤖 Backlog, stale ignores this label

Comments

@denisa
Copy link
Contributor

denisa commented Dec 26, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When the image executes on an ARM64 architecture, docker warns that it is not a native image.

In my usage, the execution fails before completing the scan of my project

Expected Behavior

Docker reports that the image supports (at a minimum) amd64 and arm64 architectures.

Anything else?

Continuation of #1956

@denisa denisa added the enhancement New feature or request label Dec 26, 2023
@ferrarimarco
Copy link
Collaborator

Hi @denisa! Thanks for your research on this.

Some of the linters we install have multi-architecture images, so buildx should be able to grab the correct one for those, IIRC.

There are some linters that don't offer this at all tho, and some that require glibc.

It would be interesting to experiment with a Debian-based image, instead of an Alpine one to see if things would be easier in that case.

@denisa
Copy link
Contributor Author

denisa commented Dec 27, 2023

my pleasure — I was waiting on the result of the discussion about collaborating with megalinter (#4591 ) to resume work on this ;-)

One big reason to experiment with an other linux version might be PowerShell, for which I only found ubuntu-based images (https://hub.docker.com/_/microsoft-powershell) with supports for both and and arm.

@YaroShkvorets
Copy link

I can't even pull the image for arm64 on Mac M1.

❯ docker pull ghcr.io/super-linter/super-linter:latest
latest: Pulling from super-linter/super-linter
no matching manifest for linux/arm64/v8 in the manifest list entries

Works if I pass --platform linux/amd64 flag though and linters seem to run fine.

@ferrarimarco
Copy link
Collaborator

Hi @YaroShkvorets ! There's no arm64 image yet. I think you're likely running the amd64 one under emulation, so I would expect some performance degradation.

Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

If you're a maintainer, you can stop the bot to mark this issue as stale in the future by adding the O: backlog 🤖 label`.

@github-actions github-actions bot added the O: stale 🤖 Stale issue/pr label Feb 11, 2024
@tchia04
Copy link

tchia04 commented Feb 11, 2024

+1

@github-actions github-actions bot removed the O: stale 🤖 Stale issue/pr label Feb 11, 2024
@cjlapao
Copy link

cjlapao commented Feb 12, 2024

On the M2 it seems to be having an issue even with the rosetta enabled

2024-02-12 11:25:33 [INFO] Stderr when building the file list:

/bin/sh: BuildFileArrays: not found
/bin/sh: BuildFileArrays: not found
/bin/sh: BuildFileArrays: not found
/bin/sh: BuildFileArrays: not found
/bin/sh: BuildFileArrays: not found

@ryanmerolle
Copy link

would love this

@h3ct0rjs
Copy link

Most of the people that are currently using arm and macs with processor Mx are suffering.
@ferrarimarco is possible to extend the build in the publishing step to generate the arm images ?

@ferrarimarco
Copy link
Collaborator

ferrarimarco commented Feb 22, 2024

Hi folks! Thanks for expressing your interest in this feature.

Adding a build target would not be enough, unfortunately.

The main issue to address is that some linters don't provide an arm64 build. See #1956 for an initial investigation about this. Things have improved a bit since the last message in that discussion because we refactored the Dockerfile.

I think a possible way forward would be to first update the table that @denisa first drafted in #1956. We can do this by commenting on this issue directly.

Any contribution is welcome!

Thanks!

@ferrarimarco ferrarimarco added the O: backlog 🤖 Backlog, stale ignores this label label Feb 22, 2024
@harryzcy
Copy link
Contributor

Can we start to have a build with those that provides an arm64 release first? I personally think having some/most linters is better than having nothing yet.

@ferrarimarco
Copy link
Collaborator

Can we start to have a build with those that provides an arm64 release first? I personally think having some/most linters is better than having nothing yet.

We would first need to assess which of the linter we ship ship an arm64 build :)

@ferrarimarco
Copy link
Collaborator

Here is the table that @denisa kindly started:

dependency arm64? slim full
dotenvlinter/dotenv-linter:3.3.0 y n y
golangci/golangci-lint:v1.52.2 y y y
ghcr.io/terraform-linters/tflint-bundle:v0.46.0.1 y y y
hadolint/hadolint:latest-alpine y y y
hashicorp/terraform:1.4.4 y y y
koalaman/shellcheck:v0.9.0 y y y
mstruebing/editorconfig-checker:2.4.0 y y y
mvdan/shfmt:v3.6.0 y y y
rhysd/actionlint:1.6.24 y y y
yoheimuta/protolint:0.43.1 y y y
zricethezav/gitleaks:v8.16.2 y y y
python:3.11.1-alpine3.17 y y y
alpine/terragrunt:1.4.4 y y y
assignuser/chktex-alpine:v0.2.0 y y y
cljkondo/clj-kondo:2023.03.17-alpine n y y
ghcr.io/awkbar-devops/clang-format:v1.0.2 n y y
ghcr.io/yannh/kubeconform:v0.6.1 y y y
scalameta/scalafmt:v3.7.3 n y y
tenable/terrascan:1.17.1 n y y
install-dotnet.sh y? n y
install-lintr.sh y? y y
install-pwsh.sh ubuntu only n y
install-raku.sh y? y y
install-rustfmt.sh y? n y
install-ktlint.sh n? y y
install-phive.sh n? y y
install-arm-ttk.sh ? n y

The first step would be to update this with the current state.

@denisa
Copy link
Contributor Author

denisa commented Feb 23, 2024

I was notified this morning that there is a PR pending (clj-kondo/clj-kondo#2289) for cljkondo/clj-kondo

@h3ct0rjs
Copy link

h3ct0rjs commented Feb 23, 2024

What are those who have y?? I also think that install-ktlint.sh is available for arm64 ,but I will do a quick check.

@denisa
Copy link
Contributor Author

denisa commented Feb 23, 2024

I wasn’t sure about the entries with question mark — I did a quick evaluation and wrote down my conclusion.

@ferrarimarco
Copy link
Collaborator

By the way, there are a few things that are not applicable anymore, such as ghcr.io/awkbar-devops/clang-format:v1.0.2.

Plus, we added a couple, such as Checkov

@harryzcy
Copy link
Contributor

harryzcy commented Feb 28, 2024

@ferrarimarco
Copy link
Collaborator

Nice work @harryzcy ! Thanks for pushing this.

@robjongbloed
Copy link

On the M2 it seems to be having an issue even with the rosetta enabled

2024-02-12 11:25:33 [INFO] Stderr when building the file list:

/bin/sh: BuildFileArrays: not found /bin/sh: BuildFileArrays: not found /bin/sh: BuildFileArrays: not found /bin/sh: BuildFileArrays: not found /bin/sh: BuildFileArrays: not found

I managed to fix this by adding -e SHELL=/bin/bash to the docker command. For some bizarre reason the amd64 emulation in docker uses a different shell.

@ferrarimarco
Copy link
Collaborator

@robjongbloed I think what you are experiencing is tracked by #5339

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request O: backlog 🤖 Backlog, stale ignores this label
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants