Search code examples
phpdockerubuntu

How to setup a php5.6 docker in Ubuntu 24.04?


I have a legacy php I wanted to deploy in a docker on Ubuntu 24.0

I have a docker:

FROM php5.6-apache

RUN apt-get update && apt-get install -y mysql-client php5.6-mysql

RUN a2enmode rewrite

EXPOSE 80

I bind the project via docker run command, the problem is the docker doesn't install mysql-client or any other libraries even though I run apt-get update (some sources are down already). It always says unable to locate the package.

How do I approach this?


Solution

  • It doesn't work anymore for php5.6-apache docker image so I used one I found:

    https://hub.docker.com/r/porchn/php5.6-apache