up
up copied to clipboard
Building inside docker alpine causes error
We created a CI pipeline where the Up application was deployed from inside a docker container using the official Golang docker image (alpine base). The build/deploy was successful as reported by Up.
All requests fail with an internal server error. The following can be found when inspecting the logs:
sh: ./server: /lib/ld-musl-x86_64.so.1: bad ELF interpreter: No such file or directory
from this post it sounds like a CGO issue—could you try changing the build hook to:
{
"hooks": {
"build": "CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o server *.go"
}
}
From what I understand CGO should be disabled by default when cross compiling though, not sure what else that would be
Cheers that worked for me. Completely different golang project but same problem and solution.