Skip to content

Conversation

@LaurentGoderre
Copy link
Contributor

@LaurentGoderre LaurentGoderre commented Jun 26, 2025

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.

@LaurentGoderre LaurentGoderre requested a review from a team as a code owner June 26, 2025 18:27
@netlify
Copy link

netlify bot commented Jun 26, 2025

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 3360483
🔍 Latest deploy log https://app.netlify.com/projects/testcontainers-go/deploys/68c835de977c8b000816c5d4
😎 Deploy Preview https://deploy-preview-3218--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@LaurentGoderre LaurentGoderre force-pushed the save-image-multi-arch branch from 2dcc37c to b5a1892 Compare June 26, 2025 18:30
@LaurentGoderre LaurentGoderre changed the title feat: Allow saving specific platforms for an image feat: allow saving specific platforms for an image Jun 26, 2025
@LaurentGoderre LaurentGoderre force-pushed the save-image-multi-arch branch from b5a1892 to a1213e5 Compare June 26, 2025 18:55
Copy link
Contributor

@stevenh stevenh left a 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.

Copy link
Contributor

@stevenh stevenh left a 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 😄

@LaurentGoderre LaurentGoderre force-pushed the save-image-multi-arch branch 4 times, most recently from 4c0121d to b4b87f4 Compare June 27, 2025 13:34
@LaurentGoderre LaurentGoderre requested a review from stevenh June 27, 2025 13:35
@LaurentGoderre
Copy link
Contributor Author

@stevenh updated! Thanks for the review!

@LaurentGoderre
Copy link
Contributor Author

FYI, we are using a simplified version of this change internally for our tests without a problem

Copy link

@neersighted neersighted left a 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.

@mdelapenya
Copy link
Member

For reference, we addressed this in the go-sdk too: https://pkg.go.dev/github.com/docker/go-sdk/image#SaveOption

@LaurentGoderre LaurentGoderre force-pushed the save-image-multi-arch branch 2 times, most recently from d464819 to b43cced Compare July 1, 2025 17:41
@LaurentGoderre
Copy link
Contributor Author

@neersighted implemented your suggestion!

@LaurentGoderre LaurentGoderre force-pushed the save-image-multi-arch branch 2 times, most recently from 0060e37 to 9c1d365 Compare July 10, 2025 01:52
mdelapenya
mdelapenya previously approved these changes Sep 11, 2025
Copy link
Member

@mdelapenya mdelapenya left a 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 🙏

Copy link
Member

@mdelapenya mdelapenya 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!

@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 🙏

@mdelapenya mdelapenya self-assigned this Sep 15, 2025
@mdelapenya mdelapenya added the feature New functionality or new behaviors on the existing one label Sep 15, 2025
@mdelapenya mdelapenya merged commit 88dead6 into testcontainers:main Sep 15, 2025
212 checks passed
mdelapenya added a commit to prestonvasquez/testcontainers-go that referenced this pull request Sep 17, 2025
* 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)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New functionality or new behaviors on the existing one

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants