docker Unable to Release Solution for Port

  • 2021-10-25 08:17:01
  • OfStack

Today, after updating the docker image, Bind for 0.0. 0.0: xxxx failed: port is already allocated appeared when running docker-compose up-d. After passing netstat-ap grep xxxx, it was found that a process 1 of docker directly occupied this port and the service could not be restarted.

Through a series of solutions:

For example, the kill process and restarting docker were unsuccessful. After sharing a method, I hope to give students who encounter the same problem a solution.


sudo cp /var/lib/docker/network/files/local-kv.db /var/lib/docker/network/files/local-kv.db_bk
sudo rm /var/lib/docker/network/files/local-kv.db
sudo docker-compose up -d

Added: docker port occupied solution "port is already allocated"

The docker startup program displays "port is already allocated" and tries the following methods

1. By restarting docker

Step 2 Restart your computer

3. Check the program corresponding to the occupied port, kill

4. All docker programs for stop and rm

It doesn't work.

A solution

Is to find the corresponding working directory under the docker-compose. yml file, modify the occupied port for other ports on the solution.


Related articles: