I have installed docker from binaries in my Linux EC2 machine.Now everytime the server reboots i need to run below commands
sudo docker &
sudo chmod 666 /var/run/docker.sock
Otherwise it give me below error
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
So i have give the above mentioned commands in ec2-user data.But still its not working and i still need to run above commands manually.
Note below is not working for me,may be because i have installed from binaries and not using yum
sudo groupadd docker
sudo usermod -aG docker ${USER}
su -s ${USER}