Skip to content

Dynamically linked Linux binaries are not compatible with MUSL C #2555

@pete-woods

Description

@pete-woods

Describe the bug

The GitHub CLI doesn't work on Alpine Linux.

Steps to reproduce the behavior

  1. docker run --rm -it alpine
  2. apk add curl
  3. curl -fsSL 'https://github.com/cli/cli/releases/download/v1.3.1/gh_1.3.1_linux_amd64.tar.gz' | tar -C /usr/local --strip-components=1 -xz
  4. /bin/sh: /usr/local/bin/gh: not found
file /usr/local/bin/gh
/usr/local/bin/gh: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, Go BuildID=fHoTSnnFVd8_yvfygXJN/whl8jqmcJwgrVZga1VFz/1O5vTCOdUnMNVQGvoQWV/v_1Dyi7uTOxQtchpd1Ks, stripped

Expected vs actual behavior

Go binaries should work on all Linux platforms when compiled statically.

I assume you're just missing the CGO_ENABLED=0 environment variable when building.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions