/var/run/docker.sock

Following @tcox's example and when I install docker on my Linux Academy Centos 7 Server, the /var/run/docker.sock group permisisons are root:root, trying a chown and it says docker group doesn't exist. Not sure if I want to add a group called docker as I don't know if that will break anything. Has anyone had this problem as well?
  • post-author-pic
    John M
    10-17-2018

    Reuben,

    While it is not best security practice to run docker daemon as root, it may be how the out-of-the-box install leaves it on our ephemeral lab servers. You have the password to sudo commands or su as root if you want to add the docker group and change it. But if this is a lab server you will only use a couple of hours, you can run as root. there is really nothing on the AWS instance to protect. Terry is traveling but may answer with something in more detail. i will leave this thread open. Just wanted to keep you moving in the interest of time. 
    Best,
    John

  • post-author-pic
    John M
    10-17-2018

    Reuben,

    I slack'd Terry and he responded with:

    "Correct, not best practice. Bug in some versions causes docker group not to be created. Best way is stop docker, create docker group, restart docker. Pid will the be owned by docker group and adding users to that group five nonroot access to docker commands." and

    "But on our servets, as root, no biggie"

    Hope that helps,

    John

  • post-author-pic
    Reuben D
    10-18-2018

    Thanks John I really appreciate the feedback this is what I did I created the docker group, chowned the docker.sock file from root:root to root:docker, added my user to the docker group and then exited out of the the root user. Then I tried the docker images command and it worked without a problem.

Looking For Team Training?

Learn More