dadatuputi/bitwarden_gcloud

Port is already allocated on restart

mannyvergel opened this issue · 2 comments

Bind for 0.0.0.0:443 failed: port is already allocated

Already tried docker-compose down and docker-compose up again to no avail. Any idea why this keeps on happening? Already happened twice.

The two things I think this could be are

  1. The Caddy container is still running for some reason. Can you confirm with docker ps -a that you don't have any running containers after the docker-compose down command?
  2. Sometimes a port will be 'reserved' for a time even after the process that used it has ended. Usually a wait of a few minutes will allow you to bind to that port again.

Beyond that I'm not sure, you could try looking at netstat to see what process is listening on 443.

Confirmed this behavior. It appears to be an issue on the docker end...

image

I was able to resolve this behavior with:

docker-compose down
sudo systemctl stop docker; sudo systemctl start docker
docker-compose up -d