Docker Community Forums

Share and learn in the Docker community.

Docker port binding error


(Ksantr) #1

I’m trying to bind my docker container to the specific ip and port. But I get the same error in any cases:

docker run -d -p 127.0.0.1:885:4000 rubi/mknews   
FATA[0002] Error response from daemon: Cannot start container b790904323695663bfeb5c24488b04283ae7:  (exit status 1)

ifconfig

docker0   Link encap:Ethernet  HWaddr 00:00:00:00:00:00  
          inet addr:172.17.42.1  Bcast:0.0.0.0  Mask:255.255.0.0
          inet6 addr: fe80::ac4d:76ff:fe19:10c8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:608 (608.0 b)  TX bytes:180 (180.0 b)


lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:28448 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28448 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3778591 (3.6 MiB)  TX bytes:3778591 (3.6 MiB)

What can be cause of this error?


(Sabin Basyal) #2

Can you run this command without the -p option?


(Ksantr) #3

Yes. It works without port binding. This image works with binding on another server with different OS. It’s no matter which port I try to use.


(Ksantr) #4

Fixed by reinstalling docker


(Sabin Basyal) #5

Thanks for the update @ksantr . It was a strange behavior, so I didn’t have any answer.