I have installed MySQL and apache using brew on my local machine and have been using them for several php project environments. Now i want to start learning docker to containerize a new Laravel environment (example) . Before i start using docker on my local machine, should i stop the httpd and mysql service ? will the 'php' and 'mysql' command have a conflict ?
The only issue you might have running the same services in containers as locally on your machine is a port conflict. Let's take httpd as an example:
- You try and start the container and you get
listen tcp 0.0.0.0:80: bind: address already in use. This is because a HTTP server is already running on your machine.
- Tell docker to bring the container up using a different local port:
docker run -p 80:8080 <your container, commands etc>. This will tell Docker to bind port
80in the container to port
8080on your machine.
- You can now access both
http://localhost:80(your machine) and