Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change build process to use busybox #17

Merged
merged 2 commits into from
Jul 31, 2024
Merged

Change build process to use busybox #17

merged 2 commits into from
Jul 31, 2024

Conversation

gcleroux
Copy link
Contributor

@gcleroux gcleroux commented Jul 30, 2024

Description of Changes

@coutug and I worked on Kubernetes Jobs for the sink. He needs a shell running inside the container to be able to synchronize workloads to order steps inside the job.

  • Compile to a static binary
  • Using -ldflag "-s -w" compile flags to reduce the binary size
  • Switch the runner image from distroless-base to distroless-static
  • Building the image inside the Dockerfile instead of GitHub Action
  • Copying a static /bin/sh shell and /bin/touch inside the distroless image (needed for the helm chart job)

Build Sizes

Build process Image Size
Distroless base w/ no shell 95.60 MB
Distroless static w/ /bin/sh 57.37 MB

Some Questions

I'm running the build step inside the Dockerfile with build-args to keep the resulting binary the same. The metadata action uses a slightly different date format
e.g. "2024-07-30T22:06:23.354Z" instead of "2024-07-30T22:06Z"

I assumed it was fine and didn't change it, but I can format it like the action if needed.

Copy link
Contributor

@fschoell fschoell left a comment

Choose a reason for hiding this comment

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

otherwise lgtm

Dockerfile Outdated Show resolved Hide resolved
@gcleroux gcleroux merged commit f9081de into develop Jul 31, 2024
2 checks passed
@gcleroux gcleroux deleted the busybox-docker branch July 31, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants