Docker
Docker is a platform used for developing, shipping, and running applications in containers. Installing it can sometimes involve several steps, and if you're setting up multiple machines or doing it frequently, remembering the exact process can be tedious.
This note serves as a quick reference for installing Docker using the convenience script provided by the Docker team.
-
Download the script:
curl -fsSL https://get.docker.com -o install-docker.sh
This command downloads the installation script from get.docker.com and saves it as
install-docker.sh
. -
Run the script:
sudo sh install-docker.sh
-
Add your user to the
docker
group:sudo usermod -aG docker (username)
Replace
(username)
with your actual username. This command adds your current user to thedocker
group. Membership in this group allows you to run Docker commands without needingsudo
. While convenient, understand that members of thedocker
group have permissions equivalent to the root user regarding Docker, so exercise caution. -
Reboot your system:
sudo reboot
-
Verify the installation: After your system has restarted and you've logged back in, you can verify that Docker is installed and you can run commands without
sudo
by running thehello-world
container:docker run hello-world