Home > OS >  Appsody :: Run simple node js express application gives error ( MacBook Pro - M1 -2020 )
Appsody :: Run simple node js express application gives error ( MacBook Pro - M1 -2020 )

Time:02-21

I am trying to run node js application by using appsody. I have installed enter image description here

CodePudding user response:

This means that the appsody/init-controller image is not available for your native platform (which is linux/arm64/v8). If you click the link (earlier in this sentence) and look at the "Tags" tab on Docker Hub you'll see this image is only being published for linux/amd64 (Intel) and two other platforms, but not for ARM64.

To make this work, you need to specify another platform. You can do that by setting this environment variable before running the application:

export DOCKER_DEFAULT_PLATFORM=linux/amd64

NOTE: Docker can do this emulation (running amd64 on ARM) using qemu, but it is sometimes unstable. You may find the containers crash. But other times it works fine; YMMV.

Another option could be to rebuild all the needed images as ARM64. To do this you'd need to identify all of the images that matter, and try to find source material to rebuild them. Sometimes those are available (e.g. on GitHub) - other times they are not published. So this may not be an option for you.

CodePudding user response:

Any one who is running docker by appsody and face the above problem below command worked for me.

The gist is to concatenate your command with @Dan Lowe command.

     {
        "label": "Appsody: debug",
        "type": "shell",
        "command": "export DOCKER_DEFAULT_PLATFORM=linux/amd64;appsody debug --network my-microservice_default --docker-options '--env KAFKA_BOOTSTRAP_SERVERS=kafka:xxxx' -p xxxx:xxxx -p xxxx:xxxx -p xxxx:xxxx",
        "group": "build",
        "problemMatcher": []
    },
  • Related