-
Notifications
You must be signed in to change notification settings - Fork 145
Add note about docker architecture on Pulumi Deployment #2997
base: master
Are you sure you want to change the base?
Conversation
Your site preview for commit c353341 is ready! 🎉 http://pulumi-hugo-origin-pr-2997-c3533411.s3-website.us-west-2.amazonaws.com. |
|
||
### Building Docker images for another architecture | ||
|
||
By default, the deployment executor will only build Docker images for the x86_64 architecture, if you need to build images for another architecture (e.g. linux/arm64), you can add the architecture as a pre-run command such as: |
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.
This isn't quite right, to execute run steps in a Dockerfile for another architecture requires an emulator to be installed. There are many tools (Rust, Go, C with the appropriate tools installed, etc.) that support cross-compilation and can build images for a target architecture without any emulator by using FROM --platform=$BUILDPLATFORM ...
to run natively, and compiling a statically linked binary for the target.
Suggest a few changes:
- Saying that the deployment engine uses x86-64 (aka
linux/amd64
) hosts. - Suggest that if users are building binaries for another platform, whether via the
Command
provider,Docker
, they reference the documentation for building cross platform tools. - Suggest the command below to install emulators for Docker, linking to Docker documentation.
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 think i oversimplified this topic because i don't fully understand it, i think it'll be better if i close this PR and let someone else that knows better to write it, the suggestions you sent are longer than the text i wrote, i'm clearly out of my area of expertise here.
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.
@sicarul were you able to update this section of the PR? I see this has been re-opened.
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.
@EvanBoyle told me to send the PR through Slack, i sent the updated changes merging the latest version
Closing in favor of a better alternative by someone who better understands this topic, sorry! |
Site previews for this pull request have been removed. ✨ |
Your site preview for commit 67df465 is ready! 🎉 http://pulumi-hugo-origin-pr-2997-67df4650.s3-website.us-west-2.amazonaws.com. |
I think we need someone to provide a bit more detail so we can bring this to completion. It sounds like we're close, but I want to be sure I understand what led up to this so we don't overcomplicate. @sicarul Was the problem that your Pulumi program was producing (when running in Deployments) an x86_64 Docker image, but you needed the image to be built for some other platform? If so, I think Friel's #1 and #2 suggestions above are probably enough (i.e., to call this out -- as it sounds like a fairly common scenario -- and then essentially point users to the Docker docs for how to address it). Would you agree? |
@cnunciato yes, i solved being able to build in arm64 by using the command proposed in the PR, which allows to host ECS Fargate services using the cheaper graviton processors. I don't see how linking to Docker docs will solve this question for future users that have this problem, is there a link that plainly explains the same solution i used, or any other that also works? I don't understand why we can't simply put the command that we know solves this problem in the docs. |
Oh, I'm sorry! I didn't mean to imply that -- totally open to adding this, I'm just looking to understand what we're actually addressing. Your note made it sound like you weren't sure yourself, so combined with the feedback and the closing and reopening of the PR without more explanation, it seemed sensible to ask for a bit more info. What you've got here essentially says, "If you want to build for another platform, run this command," so this could use some additional explanation, IMO. What does this command actually do? What is this third-party tool we're implicitly recommending users add to their pre-run scripts? Is it the only way to accomplish this, or is there another (e.g., more standard, non-third-party) option? We can certainly add this info of course, provided we understand and can explain what it is, what it does, and why you'd use it (vs. some other approach). Hence Friel's recommendations, I think -- which again make sense to me, with the exception of the emulator bit, which I admit is outside my experience with Docker. Are you planning on applying any of these recommendations? If not, would you like us to pick it up from here? |
@cnunciato as far as i know, this package that gets installed is a third party package, i've not seen it documented officially in Docker (but maybe i just didn't find it), I don't know much more than "add the emulator with this command and compiling to arm64 works on Pulumi Deploy", if someone else has a more detailed explanation i'm happy to have them edit this PR or open a new one, IMHO even a short note like the PR i sent is better than no guidance at all. |
@cnunciato should we merge or close this PR? |
Description
Adding note to specify how to build cross-platform docker images in Pulumi Deployments
Checklist:
I have manually confirmed that all new links work.I added aliases (i.e., redirects) for all filename changes.If making css changes, I rebuilt the bundle.