Saturday, December 23, 2017

Why docker need root access ?

Why docker need roots access ?
  • create namespaces
  • create cgroups
  • etc...
It listens to local daemon socket /var/run/docker.sock , which is a link to /run/docker.sock

Notice that the owner of file is socket , but group owner is docker.
so we need to just provide group access
here is how to provide group access

Now try running command from 
Notice
we can just type exit to move out from container.

How to make docker listen on network port rather than local port ?
Type command "docker -H 192.168.56.50:2375 -d &"

check program listening to port by
"netstat -tlp"
Now if you run

you can bind it to both network port and local socket

No comments: