Error:
https://www.bing.com/search?q=WARN%5B0000%5D+%2Fhome%2Fubuntu%2Fproject_to_deploy%2Fdocker-compose.yml%3A+%60version%60+is+obsolete+%5B%2B%5D+Running+1%2F0+%E2%9C%94+Container+project_to_deploy-redis-1+Created+0.0s+Attaching+to+adminer-1%2C+database-1%2C+php-1%2C+redis-1%2C+websocket-1+Error+response+from+daemon%3A+driver+failed+programming+external+connectivity+on+endpoint+project_to_deploy-database-1+(c706944851d071744c7359a42ee2ccbdc6a3731d927e4e647482d356c635eb48)%3A+Error+starting+userland+proxy%3A+listen+tcp4+0.0.0.0%3A3306%3A+bind%3A+address+already+in+use&cvid=d8210aa86c4d476d8111fd2f2965c69f&gs_lcrp=EgZjaHJvbWUyBggAEEUYOdIBBzU2M2owajSoAgiwAgE&FORM=ANAB01&adppc=EDGEESS&PC=U531
Solution 1:
Step 1: To change port 3306:
If another process or container on your system already has port 3306 occupied and you cannot turn it off, you can try changing the port of your MySQL container. In the Docker compose or Docker command, modify the port number to another number in the Ports section of the MySQL container. For example:
services:
database-1:
ports:
- "3307:3306"
Step 2: Restarting the Docker daemon:
Sometimes issues occur in Docker daemon that cause such errors. You can try restarting the Docker daemon
sudo systemctl restart docker
After that run
docker-compose up
Solution 2:
Step 2: Check for existing processes
First, check to see if port 3306 is being used by any other processes or services that are currently operating on your host computer. You can run to accomplish this:
sudo netstat -tuln | grep 3306
Step 2: Check Docker containers:
docker ps
Step 3:Stop conflicting containers:
If you find a container using port 3306, you can stop it using:
docker stop <container_id>
Step 4: Restart Docker service:
sudo service docker restart
Thanks for Reading.