waypoint-plugin-examples icon indicating copy to clipboard operation
waypoint-plugin-examples copied to clipboard

build using docker in template link to musl

Open Codelax opened this issue 2 years ago • 2 comments

Describe the bug The make docker command to build using docker and the Dockerfile produces builds that link to musl. This make the binaries not working when using them with waypoint on a system that does not have musl as libc.

Steps to Reproduce

  • Download the linux build that is produced by this build in a plugin, for example cloudfoundry
  • file the binary
 ○ file waypoint-plugin-cloudfoundry
waypoint-plugin-cloudfoundry: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-x86_64.so.1, Go BuildID=6AVyHUccoYweMVdpx9Ry/VkjT6-P2icj3imeXHyBd/XqYh8sw7MfBJRfNvR5iX/87-ju-GqBf5OD4Rr1iYh, not stripped

Expected behavior The produced binaries should not dynamically link to alpine's libc

Additional context I solved it on scaleway's side by adding CGO_ENABLED=0 when building binaries

Codelax avatar Mar 07 '23 10:03 Codelax

Thanks for writing in @Codelax - so adding a simple CGO_ENABLED=0 in our Makefile addressed the issue? If so I believe we can make that change

catsby avatar Mar 08 '23 17:03 catsby

Yes, it did fix it for me.

Codelax avatar Mar 08 '23 19:03 Codelax