Skip to content

Instantly share code, notes, and snippets.

@guidorice
Created February 14, 2025 15:48
Show Gist options
  • Select an option

  • Save guidorice/d48e29b5e290feea413ebc871f14fb63 to your computer and use it in GitHub Desktop.

Select an option

Save guidorice/d48e29b5e290feea413ebc871f14fb63 to your computer and use it in GitHub Desktop.
Alpine linux- not worth the risk

When using Alpine linux on a server or Alpine-based container deployment, what are some well known bugs or gotchas? Include one section for MUSL libc issues, and a section for other. I am aware of the DNS issue on Kubernetes, so include that one in the MUSL section.

MUSL libc Issues:

  • DNS resolution failures in Kubernetes due to MUSL's resolver not supporting search domains properly. Workaround: Use CoreDNS or external DNS servers
  • No support for NSS modules, affecting LDAP/NIS authentication
  • Incomplete locale support causing string sorting/comparison issues
  • Limited threading model can impact high-concurrency applications
  • Some compiled binaries may fail due to glibc dependencies
  • No support for dlopen() on static binaries

Other Alpine Issues:

  • Package conflicts when mixing community and main repositories
  • Limited package availability compared to other distributions
  • Init system (OpenRC) differences from systemd requiring service management changes
  • Build failures for packages assuming glibc toolchain
  • Shell script compatibility issues due to BusyBox providing minimal versions of utilities
  • Memory management differences affecting applications tuned for glibc environments

Workarounds typically involve:

  1. Using gcompat package for glibc compatibility
  2. Building from source with Alpine-specific flags
  3. Using Docker multi-stage builds to handle compile-time dependencies

source: Claude.ai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment