Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

PHP ZTS Container stops immediately

I am attempting to create a Docker container using the official PHP 7.4 ZTS image without making any modifications. However, when I start the container, it immediately stops as if the entrypoint is incorrect.

My Dockerfile contains the following content:
FROM php:7.4-zts-alpine

This is the result when I run docker compose up.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

I have tried using other official ZTS images, but they also do not work.

>Solution :

If you put tty: true in the docker-compose.yml, you will be able to keep the container running. You can also do this by using the -t flag in the docker command.

The reason FPM doesn’t require it to keep the container running is that FPM is the entrypoint.

With ZTS, bash is the entrypoint — So, once you add a tty: true to the container, bash will be able to create interactive session and the container will (or at least should be) started with bash as the entrypoint.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading