We are trying to deploy a NodeJS Docker in AWS Fargate using ECS. Code is configured to come through GitHub -> CodeBuild -> ECR -> ECS Fargate.
We are facing standard_init_linux.go:219: exec user process caused: exec format error when we run the ECS Service. When we run the image in local, it is running without an issue. When we searched regarding this error, it was mentioned that it is due to architecture mismatch.
DockerFile:
FROM node:14 as builder
COPY . /contents
WORKDIR /contents
RUN npm install
RUN npm run build
...
EXPOSE 3000
The CodeBuild architecture we tried are
- AL2 aarch64 1.0/2.0
- AL2 x86-64 2.0/3.0
- Ubuntu 3.0/4.0/5.0
What is the right environment for node 14 for CodeBuild? Is there anything else that might be causing the issue?
Any help is appreciated. Thanks!