OneBite.Dev - Coding blog in a bite size

setup docker

Simple docker step by step how to setup docker with explanation

Docker is a crucial tool for developers that enables them to create, deploy, and run applications in any environment using containerization. Let’s break down how to set it up step by step.

Firstly, you’ll need to install Docker. Below are instructions for installing Docker on different operating systems.

Windows:

  1. Visit Docker’s official website and download Docker Desktop for Windows: https://www.docker.com/products/docker-desktop
  2. Once the download is complete, open the installer and follow the prompts to complete the Docker setup.
  3. To ensure Docker is running, check your system tray to see if the Docker Desktop icon is showing.

macOS:

  1. Visit Docker’s official website and download Docker Desktop for Mac: https://www.docker.com/products/docker-desktop
  2. After downloading, open the .dmg file. Drag and drop Docker into your applications folder.
  3. Open Docker from your applications and follow the instructions to complete the setup.

Ubuntu:

  1. Update your existing list of packages:
sudo apt-get update
  1. Install a few prerequisite packages which let apt use packages over HTTPS:
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
  1. Add the GPG key for the official Docker repository:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  1. Add the Docker repository to APT sources:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  1. Update the package database with the Docker packages:
sudo apt-get update
  1. Make sure you are about to install from the Docker repo instead of the default Ubuntu repo:
apt-cache policy docker-ce
  1. Finally, install Docker:
sudo apt-get install docker-ce

Once Docker is installed on your system, verify it’s running by opening up your terminal or command prompt and typing:

docker --version

This command will display the installed version of Docker.

Now, you are ready to use Docker and can start creating and managing your Docker containers. You’ll find it indispensable as it makes it simple to create, deploy, and run applications by using containers. With Docker, you can manage your infrastructure in the same ways you manage your applications ensuring seamless, swift and easy software delivery. The journey to learn Docker is an exciting one that has just begun. Happy Dockering!

docker