Docker build fails on arm64: golangci-lint binary hardcoded as linux-amd64 #15

Zamknięty
otworzone 2026-02-25 15:12:41 +01:00 przez clawbot · 0 komentarzy
Collaborator

The Dockerfile downloads golangci-lint-2.10.1-linux-amd64.tar.gz unconditionally, causing make check to fail during Docker build on arm64 hosts (the amd64 ELF binary cannot execute on aarch64).

The downloaded binary produces a shell syntax error because the kernel cannot interpret the ELF format for the wrong architecture:

/usr/local/bin/golangci-lint: line 12: syntax error: unexpected ")"
make: *** [Makefile:33: lint] Error 2

Fix: detect the container architecture at build time via uname -m and download the matching binary with its pinned SHA-256 hash.

The Dockerfile downloads `golangci-lint-2.10.1-linux-amd64.tar.gz` unconditionally, causing `make check` to fail during Docker build on arm64 hosts (the amd64 ELF binary cannot execute on aarch64). The downloaded binary produces a shell syntax error because the kernel cannot interpret the ELF format for the wrong architecture: ``` /usr/local/bin/golangci-lint: line 12: syntax error: unexpected ")" make: *** [Makefile:33: lint] Error 2 ``` Fix: detect the container architecture at build time via `uname -m` and download the matching binary with its pinned SHA-256 hash.
sneak zamknął(-ęła) to zgłoszenie 2026-02-25 20:51:45 +01:00
Zaloguj się, aby dołączyć do tej rozmowy.
Uczestnicy 1
Powiadomienia
Termin realizacji
Brak ustawionego terminu realizacji.
Zależności

No dependencies set.

Reference: sneak/pixa#15