knative / func

Knative Functions client API and CLI
Apache License 2.0
277 stars 138 forks source link

Building containers with func #2211

Open d-m opened 7 months ago

d-m commented 7 months ago

Is it possible to specify the architecture, or build multiple architectures, using func? I'm using an ARM Mac with Podman and would like to also build amd64 images as well.

matejvasek commented 6 months ago

The buildpack build strategy should always build amd64 at this time. The s2i strategy should build for host architecture. You could however force s2i strategy to build for other architecture by specifying builder image --builder={image for the desired arch}.

matejvasek commented 6 months ago

Also not that build for another architecture will be extremely slow. If architecture of your host machine and cluster differs I recommend on-cluster-build: func deploy --remote ....

github-actions[bot] commented 3 months ago

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

mrunesson commented 3 months ago

Looks like buildpack get confused and create an image with mixed architecture. Image marked as arm64 but contains x86 code.

I using podman 5.1.1 on a Macbook with M3 and func v0.40.0.

When I build a simple go function after func create -l go hello with func build and then inspect the image with podman inspect it says Architechture arm64. When running with func run I get the error rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2 which indicates there are x86 code in it.

github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.