From e44b02e4ac507bfba3672842d9ca9fab7d293294 Mon Sep 17 00:00:00 2001 From: mbtech Date: Sun, 14 Dec 2025 23:48:10 +0000 Subject: [PATCH] Update README.md --- README.md | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dd747d0..8f128f2 100644 --- a/README.md +++ b/README.md @@ -35,4 +35,65 @@ Before you begin, ensure you have: First, update your existing list of packages to ensure you are getting the latest versions. ```bash -sudo apt update \ No newline at end of file +sudo apt update +``` +2. Install Dependencies +Install the prerequisite packages that allow apt to use packages over HTTPS. +```Bash +sudo apt install apt-transport-https ca-certificates curl software-properties-common +``` +3. Add Docker Repository +Add the GPG key for the official Docker repository to your system to ensure downloads are valid. +```Bash +curl -fsSL [https://download.docker.com/linux/ubuntu/gpg](https://download.docker.com/linux/ubuntu/gpg) | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg +``` +Add the Docker repository to your APT sources. +```Bash +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] [https://download.docker.com/linux/ubuntu](https://download.docker.com/linux/ubuntu) $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null +``` +4. Install Docker Engine +Update the package database again with the Docker packages from the newly added repo. +```Bash +sudo apt update +``` +Finally, install Docker. + +``` +sudo apt install docker-ce +``` +⚙ Post-Installation Configuration +Run Docker Without Sudo (Optional) +By default, the docker command can only be run by the root user or by a user in the docker group. To avoid typing sudo for every command, add your current user to the docker group. + +Add your user to the docker group: + +```Bash +sudo usermod -aG docker ${USER} +``` +Apply the new group membership (requires logging out or running the following): +```Bash +su - ${USER} +``` +Verify that your user is added to the group: +```Bash +groups +``` +Output should look like: sammy sudo docker + +✅ Verification +Check that Docker is running correctly. + +```Bash +sudo systemctl status docker +``` +To verify that you can pull images from Docker Hub, run the "Hello World" container: +```bash +docker run hello-world +``` + +If successful, you will see a message indicating that your installation appears to be working correctly. + +📚 Resources +Official Docker Documentation + +DigitalOcean Docker Tutorial \ No newline at end of file