I am using terraform to build infrastructure on AWS provider. I am using ECR to push my local docker images using AWSCLI.
Now, I have a Application load balancer which would route traffic to ECS_service. I want ECS to manage my Docker Containers using Fargate. But, the docker containers are exited by saying "Essential Docker container exited".
Thats the only log printed out.
If i change the docker image to be nginx:latest
(which is fetched from dockerhub). It works.
PS: My docker container is a simple node application with node:alpine
as base image. Is it something related to this, i am wrong !
Can anyone provide me with some insight on what is wrong with my approach.
I get the following error in AWS Logs:
docker-standard-init-linux-go211-exec-user-process-caused-exec-format-error
.
My Dockerfile
FROM node:alpine
WORKDIR /app
COPY . .
RUN npm install
# Expose a port.
EXPOSE 8080
# Run the node server.
ENTRYPOINT ["npm", "start"]
They say, its issue with the start script. I am just running this command. npm start
to start the server.
#!/usr/bin/env node
to your app and try running the image locally likedocker run -it <image_id> sh
if that works? It might be the case some extension which was not compiled forlinux
you might be trying to load in your app, that's why the error is forexec format
. It works with nginx because theentrypoint
is different for both images. β samtoddler