I have to make LAravel
app and to deliver a Dockerfile ,but I\'m really stuck with this. Before that I had a nightmare wile installing laravel
on m
So for me when I was trying to load and run MySQL image in docker container, I was getting the same error:
And even after stopping local mysql server in system preferences didn't help: Cause the port 3306 was used by my tomcat server, so basically you have to make sure the port (in this case 3306) that the docker command wants to use should not be in use by any other service otherwise the command will fail
The error you are seeing is from a local mysql instance listening on port 3306 (currently on pid 1370 from your comments). You won't be able to run a container that publishes on this host port while it's already in use by another process. Solutions are to either stop mysql on the local host, or to change/remove the published port in your container. If the port is only needed by other containers, you can leave it unpublished and they can communicate directly on the docker private network (by default, this is "bridge").
Running this command fixed the issue for me:
docker swarm leave --force
Explanation: I had started docker swarm service as a master node in my localhost. Swarm was taking network priority and making use of this ports already
Probably you have already a MySQL service running in port 3306. You should close it first.
Then try to end docker-compose down
and restart it with docker-compose up
.
Remember also to change the permissions after you add a file in your project (like dartisan make:auth
) with dpermit
UPDATE:
since you have changed the port to "8084" you should go to localhost:8084
If you see the apache default then you probably are browsing another server since dockervel is build upon nginx
.
You have also probably have some gaps on Docker. Don't mix your local storage with docker storage. /var/www
in a container is different than your local /var/www
. in docker-compose.yml you mount the local ~/dockervel/www
to containers /var/www
.
I would suggest that you start all over again and revert the changes you've made to your apache server. Shut it down, you don't need it. Dockervel will provide you with an NginX server in a container.
You need to change the mysql port because you are installing mysql on your machine and it takes the default port 3306
and now you are trying to make dockervel_mysql_1 run to the same port 3306 , this is why you see in the error "Address already in use"
so if you change dockervel_mysql_1 port to 3307 for example it will works fine , without stopping the mysql that is running on you machine
My fix for this issue was to go into
docker-compose.yml
and change
ports: -3306:3306
to ports: -3307:3306
then run this command again:
docker-compose up