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

[OI-670] fix: use appropriate builder images for docker credential helpers #1561

Merged

Conversation

jonnyowenpowell
Copy link
Contributor

  • (n/a) Tests written and linted ℹ︎
  • (n/a) Documentation written ℹ︎
  • Commit history is tidy ℹ︎

What this does

This change ensures that the docker credential helper binaries listed below can be executed on the Alpine and UBI9 production images.

  • docker-credential-ecr-login
  • docker-credential-acr-env

Prior to this change, the binaries were built using the golang:1.23 image. This would normally be okay, because Go by default produces statically linked binaries. However, the helpers both make use of the dependency github.com/docker/docker-credential-helpers, which forces CGO because of it's usage of system libraries to interact with local keychains. As a result, the binaries were dynamically linked, but without cross compilation, which meant they were linked appropriately for the golang:1.23 image, but not the final production images.

In Alpine, this manifested in the rather unhelpful not found error message when attempting to execute the binary. This is actually an error from the musl linker, stating that it did not find a dynamically linked library, but can be easily misinterpreted as stating that the binary was not found.

The credential helpers both use CGO, which is forced by a dependency.

This change ensures the dynamically linked results are appropriate for the target images.
@jonnyowenpowell jonnyowenpowell requested a review from a team as a code owner January 15, 2025 09:01
@jonnyowenpowell jonnyowenpowell force-pushed the fix/docker-credential-helpers-builder-images branch from 632a899 to 1ffe3e2 Compare January 15, 2025 09:35
@jonnyowenpowell jonnyowenpowell force-pushed the fix/docker-credential-helpers-builder-images branch from 1ffe3e2 to d867a62 Compare January 15, 2025 09:48
@ahmed-agabani-snyk ahmed-agabani-snyk merged commit 1f0d740 into staging Jan 15, 2025
13 checks passed
@ahmed-agabani-snyk ahmed-agabani-snyk deleted the fix/docker-credential-helpers-builder-images branch January 15, 2025 12:29
@team-container-integration
Copy link
Collaborator

🎉 This PR is included in version 2.16.9 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants