Skip to content

Statically build using musl toolchain and target alpine#558

Merged
stefanprodan merged 1 commit intofluxcd:mainfrom
pjbgf:musl-tool-chain
Jan 26, 2022
Merged

Statically build using musl toolchain and target alpine#558
stefanprodan merged 1 commit intofluxcd:mainfrom
pjbgf:musl-tool-chain

Conversation

@pjbgf
Copy link
Copy Markdown
Member

@pjbgf pjbgf commented Jan 26, 2022

Main changes:

  • Statically build controller using musl toolchain.
  • Simplifies Dockerfile by leveraging the musl toolchain static libraries provided by golang-with-libgit2@libgit2-1.1.1-4.
  • Target alpine as final base image.

Although the controller is statically built, we are targeting alpine to help users debugging the image if they so need/wish.

@stefanprodan
Copy link
Copy Markdown
Member

@pjbgf I'm not for changing the runtime image in this release. Users will not be able to debug SC nor IAC if we use distroless since there is no shell so they can't see if tmp gets filled, or test egress or list artifacts. Please use Alpine or Bookwarm.

@hiddeco
Copy link
Copy Markdown
Member

hiddeco commented Jan 26, 2022

➕ around Stefan's concerns, but no specific preference for an alternative image.

@pjbgf
Copy link
Copy Markdown
Member Author

pjbgf commented Jan 26, 2022

@stefanprodan fair point - I will stick to Alpine as it is less than 10% of the size of bookworm-slim.

@pjbgf pjbgf changed the title Statically build using musl toolchain and target gcr.io/distroless/static Statically build using musl toolchain and alpine Jan 26, 2022
@pjbgf pjbgf changed the title Statically build using musl toolchain and alpine Statically build using musl toolchain and target alpine Jan 26, 2022
Comment thread Dockerfile
Comment thread Dockerfile Outdated
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
@stefanprodan stefanprodan added area/ci CI related issues and pull requests enhancement New feature or request labels Jan 26, 2022
Copy link
Copy Markdown
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @pjbgf 🏅

@stefanprodan stefanprodan merged commit c375627 into fluxcd:main Jan 26, 2022
@pjbgf pjbgf deleted the musl-tool-chain branch January 26, 2022 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci CI related issues and pull requests enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants