Last active
January 10, 2016 18:01
-
-
Save rtfpessoa/2df94e28b2d2ca08fcf8 to your computer and use it in GitHub Desktop.
Docker group change without reload shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Execute docker command without need to kill shell after changing groups | |
sudo userdel docker || echo "Success" | |
sudo groupdel docker || echo "Success" | |
sudo groupadd -g 2004 docker | |
sudo adduser --disabled-password --gecos "" --uid 2004 --gid 2004 docker | |
sudo gpasswd -a docker docker | |
sudo gpasswd -a $USER docker | |
sudo su -c 'sudo service docker restart' -s /bin/bash $USER |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment