-
-
Notifications
You must be signed in to change notification settings - Fork 588
feat: allow saving specific platforms for an image #3218
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
feat: allow saving specific platforms for an image #3218
Conversation
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
2dcc37c to
b5a1892
Compare
b5a1892 to
a1213e5
Compare
stevenh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, I've done a quick pass with a few improvement suggestions.
stevenh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clicking the right option this time 😄
4c0121d to
b4b87f4
Compare
|
@stevenh updated! Thanks for the review! |
|
FYI, we are using a simplified version of this change internally for our tests without a problem |
neersighted
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beyond @stevenh's review which I concur with, I'd like to see this PR use string-specs for the platform (like the rest of the TC/Docker API) and use github.com/containerd/platforms.ParseAll() to transform them.
|
For reference, we addressed this in the go-sdk too: https://pkg.go.dev/github.com/docker/go-sdk/image#SaveOption |
d464819 to
b43cced
Compare
|
@neersighted implemented your suggestion! |
0060e37 to
9c1d365
Compare
6f56fac to
878a7cd
Compare
878a7cd to
5bb524d
Compare
mdelapenya
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a few comments, just typos.
Other than that, LGTM, thanks for this! And sorry for the late review, my fault 🙏
mdelapenya
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
@stevenh I saw your suggestions were addressed in this PR, that's why I'm merging it. Feel free to comment here if not, so we can do a follow-up 🙏
* main: (22 commits) chore(deps): bump golang.org/x/net from 0.28.0 to 0.38.0 (testcontainers#3299) feat: allow saving specific platforms for an image (testcontainers#3218) chore(deps): bump dario.cat/mergo from 1.0.1 to 1.0.2 (testcontainers#3238) chore(deps): bump golang.org/x/sys from 0.32.0 to 0.36.0 (testcontainers#3282) feat(redpanda): add support for http proxy (testcontainers#3258) chore(deps): bump github/codeql-action from 3.29.3 to 3.30.3 (testcontainers#3287) chore(go): bump to Go 1.24 as minimal version (testcontainers#3298) deps(mongodb): update MongoDB Go Driver to v2 (testcontainers#3278) chore(deps): bump github.com/shirou/gopsutil/v4 from 4.25.5 to 4.25.6 (testcontainers#3224) chore(deps): bump mkdocs-include-markdown-plugin from 7.1.6 to 7.1.7 (testcontainers#3284) docs: clarify no client SDKs in production modules/images, in contributing.md (testcontainers#3279) chore(deps): bump github.com/docker/go-connections from 0.5.0 to 0.6.0 (testcontainers#3285) chore(deps): bump tj-actions/changed-files from 46.0.3 to 47.0.0 (testcontainers#3283) chore(modulegen): detect missing project files after new module creation (testcontainers#3281) chore(deps): bump github.com/docker/docker in /modules/nebulagraph (testcontainers#3277) feat(nebulagraph): add NebulaGraph module (testcontainers#3266) fix: preserve unix socket schema in testcontainers host from properties (testcontainers#3213) feat(registry): add helper functions to pull and tag images (testcontainers#3275) fix(reaper): remove termSignal override (testcontainers#3261) chore(deps): bump ryuk to v0.13.0, which uses scratch as base image (testcontainers#3274) ...
What does this PR do?
This introduces a way to pass image save options (like platform) to the image client. This allows saving a specific architecture for an image.
Why is it important?
With OCI multi-arch images, it is sometimes needed to save image for a different architecture than the current one. This changes allows to control the behavior instead of defaulting to the current platform.