Docker Community Forums

Share and learn in the Docker community.

Dcoker compose up , exited with code 0

version: '3'

services:

  easyswoole:
    image: easyswoole/easyswoole3 
    container_name: easyswoole

My docker compose The YML file is as shown above. When I execute docker compose up, I will be prompted attaching to easywoole easywoole exited with code 0. How can I solve it

If the image is build according the description in Docker Hub, it is no suprise the container exits immediatly: there is no definied entrypoint script or command.

Either it is not supposed to be used like this or the image is incomplete and the maintainer needs to add an entrypoint script and/or command to the Dockerfile of the image and needs to create a new image and push it dockerhub.

I was right, it is not supposed to be used like that. Seems the image maintainer wants you to define your own command.

Try this:

version: '3'

services:

  easyswoole:
    image: easyswoole/easyswoole3 
    container_name: easyswoole
    command: ["php","easyswoole","server","start"]
    ports:
       - 9501:9501

Yes, you’re right. Thank you very much for helping me solve this problem