Last active
July 11, 2021 01:00
-
-
Save selfagency/bb422f6a5be6d8a8fc8343c6558c74b3 to your computer and use it in GitHub Desktop.
[docker without sudo]
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
#!/usr/bin/env bash | |
# 1. Add the `docker` group if it doesn't already exist | |
sudo groupadd docker | |
# 2. Add the connected user `$USER` to the docker group. Optionally change the username to match your preferred user. | |
sudo gpasswd -a $USER docker | |
# IMPORTANT: Log out and log back in so that your group membership is re-evaluated. | |
# 3. Restart the `docker` daemon | |
sudo service docker restart | |
# If you are on Ubuntu 14.04-15.10, use `docker.io` instead: | |
sudo service docker.io restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment