简体   繁体   中英

CannotStartContainerError: API error (400): OCI runtime create failed: container_linux.go:348: starting container process caused

Docker container is just running and stopped and throwing below error in AWS ECS. Could someone help.

"CannotStartContainerError: API error (400): OCI runtime create failed: container_linux.go:348: starting container process caused"

I have set the entrypoint as below.

["sudo service celeryd start && sudo service celerybeat start && service php7.0-fpm start && service rsyslog start && bash"]

It's working perfectly in the local machine.

Thanks in advance.

Try

["sudo service celeryd start && sudo service celerybeat start && service php7.0-fpm start && service rsyslog start && /bin/bash"]

OR ["sudo service celeryd start && sudo service celerybeat start && service php7.0-fpm start && service rsyslog start && /bin/sh"]

A couple reasons could be causing it:

  1. Is your local machine an arm64 device, something like m1 mac, etc.

  2. Is your Fargate set to use graviton? In the above conditions, look into https://docs.docker.com/buildx/working-with-buildx/ This will allow you to build across CPU architecture.

  3. did you use an image of the wrong architecture? If so, you will need to change where the image's FROM is set to.

Other general things, you should use sleep infinity instead of /bin/sh

Unlikely but also possible: Does some part of your container use golang? a possibility is that you built your app in golang without CGO disabled.

General docker recommendation as well: You should not put PHP and celery into the same container, generally it's best practice to have a single main application per container and use inter container communication using TCP.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM