[POSTPONED] Provide Docker ARM Image: Function not implemented exception when launching via docker-compose

As I said before, It should be relatively straight forward to provide another Dockerfile for ARM and then add this to the CI. The cache should do the rest.

The problem is, that I cannot test it, therefore I do not want to do it myself.

1 Like

You only need a copy of the dockerfile and change the base image to an ARM version:

And then add it to Github actions ofc.

1 Like

Thanks for the fast reply! I can test this and open a PR when i have time.

1 Like

Hey Sebastian,
I have freshly cloned the Squidex project (master) and tried to build the Docker image with the build.sh file. The first stage went through successfully, but in the 2nd stage, where the frontend builds, i get an error as shown in the screenshot. It looks like it has a problem with the npm run test:coverage command. Do you know this error, or did I forget to do something beforehand?

Apologies I also faced the same issue, and haven’t had chance to delve further

I guess you have to change the base image. For the frontend this is used: https://github.com/buildkite/docker-puppeteer/blob/master/Dockerfile

I guess chrome can not start on arm. Not sure.

The frontend base image uses google-chrome-stable which is not available for arm64, but we can use Chromium. I got this to work by changing docker-puppeteer Dockerfile lines 9 to 17 (inclusive) to:

&& apt-get install -y chromium fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 --no-install-recommends \

Rebuild that image.

Then, change the squidex Dockerfile stage 2 FROM (line 45) to refer to the rebuilt frontend image, and below that add the line ENV CHROME_BIN=/usr/bin/chromium , then rebuild this image as well which should now go through without error including the Angular tests.

Finally, update your docker-compose.yml to point to the rebuilt Squidex image.

2 Likes

For what it’s worth, as a workaround: you should be able to run a x86 image on ARM by passing the platform param in the docker command when running it, and it should work as expected ( in most cases )

This is a known issue on ARM with container ( docker ) images. see: https://forums.docker.com/t/run-x86-intel-and-arm-based-images-on-apple-silicon-m1-macs/117123/5

in the above discussion, they use linux/amd64 because that target platform was built, and pushed to dockerhub, but I’ve had a lot of success with using platforms that you’d assume wouldn’t work, like linux/amd64 ( I think this works because of rosetta, but I can’t be sure of that, it’s just my experience on a M1 ). So, I suggest choosing the closest published platform when choosing to do this, which is shown here:

and there is only the one platform, linux/amd64, so maybe try adding --platform linux/amd64 in all of the docker commands? I haven’t tried this myself, it may or may not work, just adding my personal experience.

1 Like

Hi,

Any update on planned support for M1 MacBooks?
Anything I can do to help test this

I still do not have a mac, so I cannot really test. PRs are very welcome.

1 Like

I have read that .net7 images are now multiplatform images, so this simple line could actually fix the problem now:

1 Like

That would be great :slight_smile:
I have a Mac, so I can test. Is there a command I need to run for docker build?

It does not work yet, I am going from error to error. The last one is this:

Hit me up when you need testing :slight_smile: And let me know if there is anything I can do to help :slight_smile:

As soon as it builds, I will post an update …

1 Like

Just another issue: https://github.com/NuGet/Home/issues/12227

I think we will have to wait a few weeks or months until everything is resolved.

Hi Sebastian,

If that helps, I have quickly tested following change to your Dockerfile and it allowed me to build and then successfuly run Squidex through docker compose from your hosting Github repository. I use Macbook Pro with M1 Max CPU.

I did following changes:

#
# Stage 2, Build Frontend
#
FROM node:18.10-bullseye-slim as frontend

ENV DEBIAN_FRONTEND noninteractive
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
ENV CHROME_BIN=/usr/bin/chromium

RUN apt-get update && \
apt-get install -y wget gnupg && \
apt-get install -y fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
    libgtk2.0-0 libnss3 libatk-bridge2.0-0 libdrm2 libxkbcommon0 libgbm1 libasound2 && \
apt-get install -y chromium && \
apt-get clean


WORKDIR /src
----- rest of dockerfile

I don’t really know how you built your base image for frontend build, but you may want to apply changes above to it, then build a multi-arch image.

Regards,
Krzysztof

2 Likes

Docker is not the problem for me. It is actually dotnet and docker.

I have used latest “master” branch from squidex repo with dotnet 7 SDK installed. No issues here.

How do you build? On Mac?