What is the consequence of using CGO_ENABLED=0?

This page summarizes the projects mentioned and recommended in the original post on /r/golang

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • distroless

    🥑 Language focused docker images, minus the operating system.

  • If your goal is small containers though, try google's distroless setup. They're going to be smaller than alpine's and Go is well documented and supported.

  • go

    The Go programming language

  • There are some subtle things that could be different. For instance I hit this one, where getting the current user without HOME and USER variables being set will fail: https://github.com/golang/go/issues/31949

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • microapp

    minimal dockerized application

  • With CGO_ENABLED=0 you got a staticaly-linked binary (see: https://en.wikipedia.org/wiki/Static_build) so it will run without any external dependencies (you can buld your dockers from 'scratch' image) Like that: https://github.com/s0rg/microapp/blob/master/Dockerfile

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts