TUSHAR CHANDAK
TUSHAR CHANDAK

Reputation: 21

how to remove the error in docker?

docker: Error response from daemon:

    driver failed programming external connectivity on endpoint jolly_yonath 
(8190e7709a4fe44b4461d3a06706d69b86950da48d5fce68e25bd897a9ed76bd): Bind for
 0.0.0.0:8888 failed: port is already allocated.

Upvotes: 2

Views: 181

Answers (2)

mohan08p
mohan08p

Reputation: 5362

On any interface on your host you can't listen on more than one port for multiple containers. So, you can't have two containers listening on port 8888 at the host level(It might be any other application you already listening, not necessarily a container). Only one can do that. And, if you try to do that it will error out that there's already something else on that port. And, it's not a docker limitation. That's just a limitation of how IP networking typically works.

To check which service is running on particular port, use the following command, in this case to check on port 8888,

$ sudo netstat -anp | grep 8888

And, if you have running docker containers check with the below command,

$ docker container ls

which will show the running containers and then verify the port on which it is running using,

$ docker container port container_id

Then, finally you can kill or stop the service and run your container on that port.

Upvotes: 2

Larry
Larry

Reputation: 226

You need to stop the container that is using port 8888.

You can find that container's id like this:

docker ps -a | grep 8888

then stop it like this:

docker stop [containerId]

Upvotes: 2

Related Questions