Docker Community Forums

Share and learn in the Docker community.

Error in updating wordpress installion to php

Hello fellow coders,
I am trying to move my existing multisite network to the Docker/Kubernetes setup for easy backup and management.
I have an environment setup at

MYSQL : 5.7.2

PHPMYADMIN: Latest

WordPress: 5.6 (the PHP version in this installation is 7.3 which I need to update)
I want to upgrade to PHP 8.0.0

I was suggested to use a docker file which I did,
wordpress/Dockerfile at 5bbbfa8909232af10ea3fea8b80302a6041a2d04 · docker-library/wordpress · GitHub

When running this with a correction in line 149 :
RUN [“chmod”, “+x”, “docker-entrypoint.sh”]
ENTRYPOINT ["./docker-entrypoint.sh"]
CMD [“apache2-foreground”]

I get the following error, 

    ERROR: for wordpress  Cannot start service wordpress: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "docker-entrypoint.sh": executable file not found in $PATH: unknown
    ERROR: Encountered errors while bringing up the project.
    PS C:\Users\dev> docker-compose up -d
    dev_db_1 is up-to-date
    Starting dev_wordpress_1 ...
    Starting dev_wordpress_1 ... error
    
    ERROR: for dev_wordpress_1  Cannot start service wordpress: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "docker-entrypoint.sh": executable file not found in $PATH: unknown
    
    ERROR: for WordPress  Cannot start service wordpress: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "docker-entrypoint.sh": executable file not found in $PATH: unknown
    ERROR: Encountered errors while bringing up the project.

I need your help in getting my WordPress image running, I am unsure about what does this, (docker-entrypoint.sh) contain, or where to place it.

Your help and guidance is well appreciated in advance.

Regards,
Aaditya

Did you delete the line where docker-entrypoint.sh was copied into the image? The error message indicates that the file is missing or not found. Why don’t you use the image from Docker Hub instead of building from the Dockerfile?

Usually it in /usr/local/bin. Exactly as it was copied to in the original Dockerfile.

COPY docker-entrypoint.sh /usr/local/bin/

When you start a container, the final command running inside the container is built from SHELL, ENTRYPOINT and CMD directives. For example:

docker-entrypoint.sh php --version

or

docker-entrypoint.sh --version

No I didn’t do that,
I created a docker compose file and just spawned containers and started using it locally.

Later when the updates were needed I had to use docker file to achieve the same.

What is the benefit of building the image instead of downloading? Do I misunderstand something?

I am restarting the experiment again, dear one.
My team is trying to move our WordPress installing over docker to containerise it and host it on AWS/AZURE any advice that you have is really welcome. I am sorry I couldn’t reply earlier I had to resolve the exiting bugs, I want it to be as flexible and simple as running a single command to update the PHP version, but that’s the ideal case .

It’s OK, but I can’t say much more than I could before. The message was clear. The container couldn’t find the entrypoint file. The original image wouldn’t have had this problem so you have to find out where is that entrypoint file, why it is missing or if it is not missing then why it is not in PATH

I still don’t understand why you want to modify the Dockerfile of an official docker image. You shouldn’t do that. I mean you can and I can imagine a reason I just don’t know yours. If you tried to answer that in your previous message, then I am sorry but I didn’t understand.

If you can share your modified Dockerfile, I can look for mistakes, but I don’t have any idea without that.