openshift / openshift/origin

Consider building openshift binaries with CGO_ENABLED=0

Open
#13,849 4 comments 0 reactions 1 assignee View on GitHub

@smarterclayton is already working on this.

Since Apr 21, 2017.

component/internal-tools kind/feature lifecycle/frozen lifecycle/rotten priority/P2
Dominant language
Go
Stars
8.7k
Forks
4.8k
Avg merge
4d 10h
Merged PRs (30d)
53

Description

Currently the binaries produced by the release process seem to depend on the particular libc used to build them (most likely glibc). This makes them not work in Linux distros with musl (or other alternative libcs), such as Alpine.

I don't pretend to know enough Go to entirely understand the ramifications of this - but given that the build is almost static now, and building with CGO_ENABLED=0 seems to drop the binary size (from 283M to 257M) - would you consider tweaking the release process to make fully static binaries?

Version

[provide output of the openshift version or oc version command]

Steps To Reproduce
  1. Download the openshift binary from github releases
  2. Try to run it in alpine linux
Current Result
/bin/sh: openshift: not found

This is because it's looking for glibc and failing to find it.

Expected Result

Prints usage and exits.

Additional Information

https://github.com/openshift/source-to-image/issues/727 is similar and targetted at s2i

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.