Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run same docker images twice

I am using this docker command for running graylog2.

docker run -t -p 9000:9000 -p 12201:12201 graylog2/allinone

I want to run another graylog2 in same server and I run new command with different port numbers as

docker run -t -p 9001:9000 -p 12202:12201 graylog2/allinone

It's not working because of port conflict.

I am getting this error

Caused by: java.net.ConnectException: Connection refused: /127.0.0.1:12900
like image 685
maskapsiz Avatar asked Sep 20 '25 05:09

maskapsiz


1 Answers

Use docker run --name="new_name" -d imagename

Use different port for mapping from container to host or use host networking.

like image 82
Nishad A Avatar answered Sep 22 '25 21:09

Nishad A