0

I have been troubleshooting this for hours, I cannot understand it. The Dockerfile contains:

FROM node:16.13-alpine 
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD [ "node", "./bin/www" ]

I am running a fairly simple express app. when I go to http://localhost after running it on host port 80 it works. Then I push the image to ECR, create a task definition with appropriate security groups, roles, etc, and use it to launch a service. The service continually attempts to launch the task, which immediately stops with

standard_init_linux.go:228: exec user process caused: exec format error

My local machine is a Mac running on M1. Let me know if there is any additional information that would. help diagnose this issue.

Any help is greatly appreciated. peace

Liam White
  • 121
  • 6
  • 1
    Which EC2 instance type are you using? Is an ARM based instance? It seems to be an incompatibility with cpu architecture – OARP Dec 19 '21 at 15:19
  • You'll get that error if you run an M1 (ARM) image on an x86 host. Does it help to change the image to use an x86 base, `FROM --platform=linux/amd64 node:16.13-alpine`? This is suggested in [Docker buildx with node app on Apple M1 Silicon - standard_init_linux.go:211: exec user process caused "exec format error](https://stackoverflow.com/questions/66080348/docker-buildx-with-node-app-on-apple-m1-silicon-standard-init-linux-go211-ex). – David Maze Dec 19 '21 at 16:30
  • @DavidMaze Hey! That worked! I can't thank you enough. Happy coding! – Liam White Dec 19 '21 at 17:13

0 Answers0