question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Function not implemented" error on Mac M1, works on Ubuntu

See original GitHub issue

Hey team,

I’m currently stuck in the “Function not implemented” error which blocks me from using my Mac. How to reproduce:

  1. Follow https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local to create a nodejs function, add "start": "func start" into package.json
  2. Create a Dockerfile to use ubuntu:bionic image and install depedencies
FROM --platform=linux/amd64 ubuntu:bionic

RUN apt update && \
  apt install -y \
  apt-transport-https \
  curl \
  lsb-release gnupg \
  virtualenv && \
  curl -sL https://packages.microsoft.com/keys/microsoft.asc | \
  gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.asc.gpg && \
  curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | \
  apt-key add && \
  echo \
  "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" \
  > /etc/apt/sources.list.d/azure-cli.list && \
  echo \
  "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-$(lsb_release -cs)-prod $(lsb_release -cs) main" \
  > /etc/apt/sources.list.d/dotnetdev.list && \
  echo "deb https://deb.nodesource.com/node_10.x disco main" \
  > /etc/apt/sources.list.d/nodesource.list && \
  apt update && \
  apt install -y \
  azure-cli \
  azure-functions-core-tools \
  libicu-dev \
  build-essential \
  nodejs \
  unzip \
  zip && \
  useradd -m azure && \
  chown -R azure:azure /home/azure/.bashrc && \
  mkdir -p /root/.azure-functions-core-tools/Functions/ExtensionBundles && \
  cd /root/.azure-functions-core-tools/Functions/ExtensionBundles && \
  curl -O https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/2.4.0/Microsoft.Azure.Functions.ExtensionBundle.2.4.0.zip && \
  mkdir -p Microsoft.Azure.Functions.ExtensionBundle/2.4.0 && \
  unzip Microsoft.Azure.Functions.ExtensionBundle.2.4.0.zip -d Microsoft.Azure.Functions.ExtensionBundle/2.4.0 && \
  cd -

USER azure
  1. Create a docker-compose.yaml file
version: "3.7"

services:
  demo:
    container_name: demo
    build:
      context: .
      dockerfile: ./Dockerfile
    user: root
    working_dir: /work
    ports:
      - "7071:7071"
    volumes:
      - ./MyFunctionProj:/work
    command: sh -c "ls -lrt && npm start -- -p 7071 --cors-credentials --cors 'http://localhost:7070'"

networks:
  default:
    driver: bridge
    driver_opts:
      com.docker.network.driver.mtu: 1400
  1. Start the docker in Ubuntu environment and Mac M1 environment

Thank you. Folder Mac-M1 Ubuntu

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:14
  • Comments:49 (6 by maintainers)

github_iconTop GitHub Comments

30reactions
3issambencommented, Feb 16, 2023

I was facing the same issue on my Mac M1. I have managed to resolve it by doing the following

  • update docker to 4.16.2
  • enable “Use rosetta for x86/amd64 … " option in settings > Features in development”
  • set platform to “linux/amd64” when running docker build

You can follow detailed steps and explanation here http://issamben.com/running-azure-function-as-docker-container-on-an-m1-m2/

6reactions
diberrycommented, Feb 24, 2022

@anthonychu @stefanushinardi Can you please provide an update for ETA on developing Azure Functions on an M1 chip in docker? Is this a Docker issue or an Azure Functions issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

docker compose on mac m1 error: Function not implemented
if docker compose up, one of the containers throws an error: Unhandled Exception: System.IO.IOException: Function not implemented at System.
Read more >
Apple M1 chip throws "Function not implemented"
So I just got my new Macbook Air with the new M1 Chip. So far, everything works for my project (all run via...
Read more >
Multipass on Apple Silicon
1.) I have an (m1) Apple Studio Ultra, fully configured, and a bunch of intel Macs. I have it (mostly) working. I am...
Read more >
Why new Macs break your Docker build, and how to fix it
New Macs can break your Docker image build in unexpected ways; learn why, and how to fix it.
Read more >
Docker on M1 Max - Horrible Performance
Docker for Mac performance continues to be horrible on the M1. Does anyone know if Docker plan to improve this situation?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found