up icon indicating copy to clipboard operation
up copied to clipboard

Building inside docker alpine causes error

Open mhemmings opened this issue 6 years ago • 2 comments

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

mhemmings avatar Nov 11 '18 19:11 mhemmings

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

tj avatar Nov 12 '18 14:11 tj

Cheers that worked for me. Completely different golang project but same problem and solution.

danfletcher1 avatar Apr 29 '20 12:04 danfletcher1