Failed: port is already allocated

I use Docker to run Oracle 11g Express on macOS Sierra 10.12.2

https://github.com/wnameless/docker-oracle-xe-11g

That's my fault:

Last login: Sat Jan 7 22:42:11 on ttys000 ➜ ~ docker run -d -p 49160:22 -p 49161:1521 wnameless/oracle-xe-11g docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?. See 'docker run --help'. ➜ ~ docker run -d -p 49160:22 -p 49161:1521 wnameless/oracle-xe-11g 043d8caecbb45d6e2e5999b69a2f760c20d53ff3aa2fad78cb1eb70acb058a1f docker: Error response from daemon: driver failed programming external connectivity on endpoint serene_lalande (08bb0bd9684c0f92db7b736986bf894d3a57a714324405823496d13e175e7491): Error starting userland proxy: Bind for 0.0.0.0:49161 failed: port is already allocated. ➜ ~ 

I diagnosis:

 ➜ ~ netstat -anp tcp | grep 49161 tcp4 0 0 192.168.1.2.49161 17.188.166.13.5223 ESTABLISHED ➜ ~ ➜ ~ docker --version Docker version 1.12.5, build 7392c3b 

My Dianostic ID: 20EB9506-CC72-4093-8A15-60E05A841ED1

I do not know why. Prior to this, he has been successful for several weeks. Almost, I change, release a new DHCP IP address. How to run a Docker instance with Oracle 11g success?

+5
source share
2 answers

you cannot run twice

docker run -d -p 49160:22

since this means that you want to allocate port 49160 on the host twice, of course, the second time, you get an error message, try the second run

docker run -d -p 49161:22

+5
source

You will need to use a different port instead of 49161. Try a port less than 49152.

You have an existing connection between port 49161 on your computer and port 5223 on a remote Apple server. Therefore, this port cannot be used for anything else until this connection ceases to exist. Port 5223 is used for Apple push notifications. As far as I can tell, this time your computer accidentally used random port 49161 to connect to an Apple server. Previously, when this Docker container worked, I would put that port 49161 on your computer was not used.

Whenever you connect to a remote server, your own computer allocates a random port number for this connection. This time your computer allocated 49161 when it connected to Apple's push push service. Next time it may be a completely different number. See https://en.wikipedia.org/wiki/Ephemeral_port

0
source

Source: https://habr.com/ru/post/1262468/


All Articles