Docker Arm64 - Unable to start

Im having some trouble getting the arm64 docker image to run properly. When attempting to start the container I get the following error:
“exec ./Universal/Universal.Server: exec format error”

Here is some information about my environment:

  • k3s variant of Kubernetes
  • four nodes, all four are raspberry pi model 4’s, 3 with 8gb of ram, 1 with 4gb

I also tested running the amd64 image in the same environment by adding an amd64 node which I have since removed. When testing on amd64 the container starts flawlessly.

Im still a bit new to using kubernetes so its possible its a problem with my setup and Im just doing something stupid

Product: PowerShell Universal
Version: 3.8.2

Hi @Ctowle

Which versions of the container images have you tested?

Do you have a yaml script?

I tried both latest and 3.8.2-ubuntu-latest-arm64v8, I had also tried previous X.X.X-ubuntu-arm64v8 tags.

I removed the application from my cluster but I will try re-creating it today and provide the yaml

Hi @Ctowle,

In order to put some proof to a theory, Can you try pulling and running the following 2 images:


I suspect the 1st one will fail, and the 2nd one will run.

Yep looks like the first image failed to start at all with the following error:

exec /usr/bin/pwsh-preview: exec format error

The second image appears to have started, opened powershell and then exited which I assume is the normal behavior if you just pull and run this image. Here is what I see in the logs for the second image:

PowerShell 7.3.3
PS /> 

I suspect you have no emulation layer allowing the arm64 device to use amd64 images.

The images I gave you were Microsoft provided Ubuntu images with PowerShell installed.

Image 1 is what @adam uses to build PowerShell on top of.

Image 2 is a similar image build with Kubernetes in mind to run on the arm64 architecture.

Where arm64 is not new, we are beginning to see it more and more in the data centre to drastically reduce cost. Microsoft do not seam to use multi arch build images, which present complexities.

Hmm I might just try building my own image then. I didn’t realize cross architecture emulation was a thing for containers, now that I’ve looked into it it looks cool and its nice to know its an option but I would prefer to avoid emulation so resources are not wasted on the overhead from emulation.

I’ve run the arm64 zip package for PSU on my Pi’s in the past and it worked great so theoretically all I should need to do is make an image with the zip installer, pwsh 7 and ubuntu for arm64 as the parent image

Hi @Ctowle,

I’m not the best at docker build however, if was going to try this my 1st attempt would be to:

  1. Use the Ubuntu 20.04 image on Docker hub (This has multi arc build - Docker)

2. Install Powershell-Core matching the version of the PSU image you are trying to rebuild.
3. Replicate the build script in this forum post: Docker image not working - #39 by adam
4. use ‘docker buildx’ over ‘docker build’ to build your container.

If that all works as expected, that should give you a Multi arch container you can use on most devices.

Please let me know if you have any questions.