Azure / azure-functions-docker

This repo contains the base Docker images for working with azure functions
MIT License
269 stars 118 forks source link

Azure Functions Dotnet (Isolated) - arm64 Docker images are missing #695

Open justinmchase opened 2 years ago

justinmchase commented 2 years ago

For this image repo: https://hub.docker.com/_/microsoft-azure-functions-dotnet-isolated

Please produce arm64 images as well.

mohsinonxrm commented 2 years ago

@justinmchase , can you give this a try: from docker: mohsinonxrm/azure-functions-dotnet:4-isolated6.0-appservice-arm64v8

let me know how it goes.

justinmchase commented 2 years ago

Sorry @mohsinonxrm , I would need an officially supported image and I don't think it would be safe to run an image not even tied to a git repo or official channel.

However if you were to supply a link to a Dockerfile and maybe a description of how you're building the images yourself that may be very helpful.

mohsinonxrm commented 2 years ago

@justinmchase , I totally understand. BTW, I don't mean for anyone to trust these and use them in production. Maybe they want to play and explore in DEV, that's fine. However, of course for PRD, it has to be supported and come from MS official.

I'll add more details here how these were generated but some info I added is here: https://github.com/Azure/azure-functions-docker/issues/487#issuecomment-1236274099

I took the official Dockerfiles from the azure-functions-docker repo release and updated to build against ARM64 on ARM64 machine.

I'll add more details later.

mohsinonxrm commented 2 years ago

@justinmchase , so here are some additional details. You or anyone else can follow the same and generate these docker images themselves as well and maintain their own CI pipelines (if MS doesn't support or accept a PR for whatever reason).

First the docker files: I took them from the release: https://github.com/Azure/azure-functions-docker/releases/tag/4.11.1

Extract the contents of the 4.11.1-appservice.zip Here are the dotnet appservice Dockerfiles \host\4\bullseye\amd64\release\dotnet

You can see that they're building the azure-functions-host with RID for linux-x64, change that to linux-arm64 (this potentially could be removed if the CI is done natively on a x64 and ARM64 machines, it'll automatically publish to target platform)

Anyway, that's the first modification I did.

Next, you'll see they're referencing the azure-functions-extension-bundles, for this I forked their repo and updated the 2.x and 3.x branches and added build configuration to publish for linux-arm64. I generated the artifacts and uploaded to release (https://github.com/mohsinonxrm/azure-functions-extension-bundles/)

That's pretty much it really, then you just docker build -f [file name] -t [tag name] . and you're done.

I also built the function-cli (azure-functions-core-tools) by forking it and updating the script to publish for linux-arm64 in build.sh script. I used x4.x branch for that.

And that's it. You can then use the function cli natively on ARM64 to init projects and test them locally and also add the Dockerfiles if needed (referencing your own image for ARM64).

Regarding the SDK, Runtime and Deps, Microsoft already has ARM64 for those, so docker will pull down those and build the image.

Anyway, hope this helps you understand the way I was able to generate the images.

I might actually do a PR and see if MS would want to merge in, but since it impacts a couple of repos, I'm not sure.

thejasonfisher commented 2 years ago

Another list of steps to get this working with python -

https://github.com/Azure/azure-functions-python-worker/issues/1164

mohsinonxrm commented 2 years ago

Images are multi-architecture now: (again not for PRD use, just learning and dev/test) https://hub.docker.com/r/mohsinonxrm/azure-functions-dotnet mohsinonxrm/azure-functions-dotnet:4-isolated6.0-appservice mohsinonxrm/azure-functions-dotnet:4-isolated6.0 mohsinonxrm/azure-functions-dotnet:4-appservice mohsinonxrm/azure-functions-dotnet:4

mohsinonxrm commented 1 year ago

I've just updated the multi-architecture images with the latest release, host and added dotnet 7 and 8-preview.

https://hub.docker.com/r/mohsinonxrm/azure-functions-dotnet/tags

mohsinonxrm/azure-functions-dotnet:4-isolated8.0-appservice-preview mohsinonxrm/azure-functions-dotnet:4-isolated8.0-preview mohsinonxrm/azure-functions-dotnet:4-isolated7.0-appservice mohsinonxrm/azure-functions-dotnet:4-isolated7.0 mohsinonxrm/azure-functions-dotnet:4-isolated6.0-appservice mohsinonxrm/azure-functions-dotnet:4-isolated6.0 mohsinonxrm/azure-functions-dotnet:4-appservice mohsinonxrm/azure-functions-dotnet:4

Not to be used in any official or supported capacity, certainly not in production

kurt-mueller-osumc commented 5 months ago

Now that Microsoft's released Surface Laptop, which is Windows on ARM, what's the over/under of how many months it'll be until the Azure Functions docker image for aarch64 is released?

adamthole commented 2 months ago

Is there any update on this issue? As far as I can tell Microsoft still hasn't released any arm64 Docker images. Is there a technical reason for this?

juanlenoves commented 1 month ago

Would be really nice to get these released officially with arm64 support

andrewbuckingham commented 1 week ago

I was hoping the new .NET 9 release might result in Microsoft producing an arm64 image to go with it, but unfortunately not.

Thanks to @mohsinonxrm for their excellent work supporting the community though.

mohsinonxrm commented 6 days ago

well... I'll have some down time, maybe I'll refresh the images to the latest stuff.