I need a Debian8 + php7 + mysql + apache2 image.

I try

docker search debian8+php7+apache+mysql 

but produces results completely unknown.

Maybe there are some secrets to search? Or maybe there is an opportunity to collect your image?

  • Such images are generally not taken. Usually in one container one process. That is, a separate container with MySQL, separate with Apache and PHP. Of course, you can always collect your image, but is it necessary? - D-side
  • You need to run the site on php7 in parallel with php5.6. How to do this with docker? - Sergey
  • what meaning did you put into the word "parallel"? - aleksandr barakin
  • on one server, on a single copy of debian - Sergey

1 answer 1

There are no secrets to search . Because there is nothing special to look for. Use official images , there are not so many of them, and combine your application from them.

Different versions of php live here , it is better to start MySQL from a separate image, believe it will be much more convenient. Build an image with installed PHP / Nginx / MySQl - "spit time", but then the point of using docker? It will already look like a "simple VPS". Yes, and make keep the image up to date.

Reply to comment:

You need to run the site on php7 in parallel with php5.6. How to do this with docker?

Of course! For this, Docker is needed - it is easy to create, move, modify and save the project environment. Running "on one server" different combinations of software.

Assume that the source files (our project) in the directory ./www :

 # при запуске (тестировании) используем --rm, дабы не захломлять диск ненужным docker run --rm -it -p 8080:80 -v $(pwd)/www:/var/www/html php:7-apache # в другом терминале docker run --rm -it -p 8081:80 -v $(pwd)/www:/var/www/html php:5.6-apache 

We get a working project http://localhost:8080 on php7 and http://localhost:8081 on php5.6. This is just an example, a very simple example. In reality, it will be more difficult, but the essence will remain.

If you need to use real domains in the development, here's a great thing.

You can create separate Docker files for different configurations. I usually use the docker/* directory in the project root and there are sub-directories with different configurations for the project, for example docker/php7-apache

ps This answer is quite verbose, and in general was written as a replica of a comment. I myself once tried to collect images and look for ready-made solutions, until I realized that this often does not make sense. For most projects, the official images of the thing! Just change the configuration and that's it.