Solution to Docker's failure to release ports

Solution to Docker's failure to release ports

Today I encountered a very strange situation. After updating the docker image, I ran docker-compose up -d and the message Bind for 0.0.0.0:xxxx failed: port is already allocated appeared. After netstat -ap | grep xxxx, I found that a docker process had been occupying this port and the service could not be restarted.

Through a series of solutions:

For example, killing the process and restarting Docker did not succeed. I will then share a method that I hope will provide a solution to students who encounter the same problem.

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

Supplement: Solution to the docker port being occupied "port is already allocated"

The Docker launcher displays "port is already allocated". I tried the following methods:

1. By restarting Docker

2. Restart your computer

3. Check the program corresponding to the occupied port and kill it

4. stop and rm all docker programs

None of them work.

Solution

The problem can be solved by finding the docker-compose.yml file in the corresponding working directory and changing the occupied port to another port.

The above is my personal experience. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. If there are any mistakes or incomplete considerations, please feel free to correct me.

You may also be interested in:
  • Docker file storage path, modify port mapping operation mode
  • How to add docker port and get dockerfile
  • Docker primary network port mapping configuration
  • How to modify the port mapping of a running Docker container
  • How to dynamically modify container port mapping in Docker
  • Docker port mapping and external inaccessibility issues
  • Docker image access to local elasticsearch port operation

<<:  A detailed analysis and processing of MySQL alarms

>>:  HTML 5 Reset Stylesheet

Recommend

How to update the view synchronously after data changes in Vue

Preface Not long ago, I saw an interesting proble...

Vue sample code for online preview of office files

I'm working on electronic archives recently, ...

Ubuntu View and modify mysql login name and password, install phpmyadmin

After installing MySQL, enter mysql -u root -p in...

Detailed explanation of the use of grid properties in CSS

Grid layout Attributes added to the parent elemen...

Detailed explanation of identifying files with the same content on Linux

Preface Sometimes file copies amount to a huge wa...

Apache Calcite code for dialect conversion

definition Calcite can unify Sql by parsing Sql i...

How to clean up Alibaba Cloud MySQL space

Today I received a disk warning notification from...

VMware installation of Ubuntu 20.04 operating system tutorial diagram

Memo: Just experience it. Record: NO.209 This exa...

MySQL 8.0.13 decompression version installation graphic tutorial under Windows

This article shares with you the MySQL 8.0.13 ins...

Summary of MySQL database usage specifications

Introduction: Regarding MySQL database specificat...

Steps to deploy ingress-nginx on k8s

Table of contents Preface 1. Deployment and Confi...

MySQL 8.0.12 installation graphic tutorial

MySQL8.0.12 installation tutorial, share with eve...

In-depth understanding of the use of Vue

Table of contents Understand the core concept of ...

Vue.js implements simple folding panel

This article example shares the specific code of ...