Skip to content

Instantly share code, notes, and snippets.

@ErykDarnowski
Last active July 31, 2023 02:37
Show Gist options
  • Save ErykDarnowski/58a94e111d07f873224a087d5eaa4577 to your computer and use it in GitHub Desktop.
Save ErykDarnowski/58a94e111d07f873224a087d5eaa4577 to your computer and use it in GitHub Desktop.
How to automatically and easily install Docker on Linux

How to automatically and easily install Docker on Linux

  1. Make sure you have curl installed and run:
curl https://get.docker.com -s | sh
  1. (you may not have to perform this step) Get command for installing newuidmap and newgidmap binaries by running:
dockerd-rootless-setuptool.sh install

copying and running the output.

  1. Set up running docker as a non-privileged user (without sudo):
dockerd-rootless-setuptool.sh install
  1. Add the displayed lines to your shell config file (~/.bashrc ; ~/.zshrc etc.):
# For example:
sudo apt install mblaze #\*
echo -e "\nmexport PATH=/usr/bin:$PATH\nexport DOCKER_HOST=unix:///run/user/1000/docker.sock" >> ~/.bashrc
  1. Check if docker was installed correctly and is working:
docker -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment