Skip to content

Conversation

@R-Rudolf
Copy link
Contributor

Fixes issue #12.

Problem

The Docker image fails to run with the error exec /bin/gitmal: no such file or directory even though the binary exists. This occurs because the Go binary is dynamically linked and expects glibc, but Alpine Linux uses musl libc. The misleading error actually indicates the dynamic linker (/lib64/ld-linux-x86-64.so.2) is not found.

Solution

Set CGO_ENABLED=0 during the build to compile a statically linked binary that doesn't depend on external C libraries. This is the standard approach for Go binaries in Alpine-based containers.

Changes

  • Added CGO_ENABLED=0 to the go build command in Dockerfile
  • Added smoke test to GitHub Actions workflow to catch similar issues before publishing

Testing

docker build -t gitmal-test .
docker run --rm gitmal-test --help  # Now works correctly

@antonmedv antonmedv merged commit f473903 into antonmedv:master Dec 25, 2025
1 check passed
@R-Rudolf
Copy link
Contributor Author

I am sorry, missed a problem in the build verification, please review to fix it: #20

@R-Rudolf R-Rudolf mentioned this pull request Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants