

There is one catch though and I will update post right now:Īpache config is no longer needed. If you have any issues then, it could be anything, from Magento cache to browser cache, but there is no delay on anything you change in html directory. Those are the same files you have on your host.

When it comes to data, you have html directory and it totally doesn’t care if docker container is running or not. Why apache+php on one image? Just easier for us do distribute between ourselves and teams. Yes, I would usually use official images if they are good, but in this case, I’m not really sure what would I use instead, because official PHP images require additional build for all extensions you might need. There are lots of official images that suck and also many that are not official and are great. When it comes to “advising official”, I think that’s just not true. I chose it because it is lightweight and compliant with latest M2 requirements.

I got docker image from dockerhub (as you can see from links in comments) and as mentioned in the text it is created by my work colleague. git directory into html and checkout master branch while in the base directory I checkout m2-docker branch. I usually create git repository which initially ends up with 2 branches like for example m2-docker and master and then I copy.

Just check docker-compose.yml (service name).Īlso, relevant credentials are in. Note that you need to use “db” when referring to database address, and so on. Magento should be installed in “html” directory. Mine looks like this: CONTAINER_PREFIX=m2dockerĭOCKER_EXEC=docker exec DOCKER_EXEC_INTERACTIVE=docker exec -i DOCKER_EXEC_TTY= $ …and xdebug.ini zend_extension=xdebug.soĪ this point we have working environment, so let’s try to run it: tomas ~ /m2.docker $ docker-compose up -dĬreating network "m2docker_default" with the default driverĬONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESĮ3384b0eff8c mysql: 5.7 "docker-entrypoint.s…" 3 seconds ago Up 2 seconds 3306 /tcp m2docker_db_1ĭ283bf018330 phpmyadmin /phpmyadmin "/run.sh phpmyadmin" 3 seconds ago Up 2 seconds 9000 /tcp, 0.0.0.0: 8080- > 80 /tcp m2docker_phpmyadmin_1ĭed8bce1d993 redis:latest "docker-entrypoint.s…" 3 seconds ago Up 2 seconds 6379 /tcp m2docker_redis_1įe8a80763ac6 udovicic /echo:apache-php7.1 "/start.sh" 3 seconds ago Up 2 seconds 0.0.0.0: 80- > 80 /tcp, 9000 /tcp m2docker_apache-php_1 In this file you can write variables that will be used in docker-compose.yml Tomas ~ /m2.docker $ touch docker-compose.yml Tomas ~ /m2.docker $ touch docker /xdebug.ini It is more about setup capable of running Magento 2 via Docker, so this article assumes that you are somewhat familiar with Docker.įirst thing you should do is add this line somewhere in your /etc/hosts file: 127.0.0.1 m2.docker We will need some filesystem structure, so do the following: tomas ~ $ mkdir m2.docker What I’m going to share now is not some Docker wisdom. If the sentence above doesn’t make any sense to you, then maybe it would be wise to visit and at some point come back here, otherwise, continue reading… It performs operating system level virtualization (containerization) which refers to the operating system feature in which the kernel allows the existence of multiple isolated user-space instances.
#Phpmyadmin docker manual
Over the years I went the whole path from xampp, manual LAMP setup, vagrant…Īll those had at least 1 dealbreaker, especially when I started working with Magento.įinally, Docker came and made development much easier.Īt this point, it becomes a little bit tricky to explain what Docker is. Honestly, I don’t know if I could even set up such a blasphemy today.ĭue the fact that udovicic/echo:apache-php7.1 is updated, you no longer need apache config, so I edited this post and removed apache configuration. When I first started with PHP a long time ago, I really had trouble setting up work environment.ĭon’t ask me how, but I ended up with Apache Tomcat running PHP.
