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

Closed
opened 2026-02-25 15:12:41 +01:00 by clawbot · 0 comments
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 closed this issue 2026-02-25 20:51:45 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sneak/pixa#15
No description provided.