Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Add note about docker architecture on Pulumi Deployment #2997

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,11 @@ By default, the deployment executor will attempt to install dependencies for you
This is enabled by skipping the default dependency installation step (under Advanced Settings in the UI), and setting a few pre-run commands and environment variables.

![Pulumi UI - Node Version](../ui-node-version.png)

### 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:
Copy link
Contributor

@AaronFriel AaronFriel Jun 7, 2023

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:

  1. Saying that the deployment engine uses x86-64 (aka linux/amd64) hosts.
  2. 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.
  3. Suggest the command below to install emulators for Docker, linking to Docker documentation.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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


```
docker run --privileged --rm tonistiigi/binfmt --install arm64
```