In previous posts, we've learned what Docker is and how it is useful in the software industry. Now, we are going to install Docker in a few steps using commands. You can install Docker on your local machine, like a Windows or Mac desktop. But as a DevOps engineer, you mostly work on cloud infrastructure, so it is good to use a command-line interface like Linux to install and use Docker on it. It helps you save time and effort when building a new Docker artifact.
You can use VMs on the local machine or any cloud provider's instance to download Docker.
These commands help you have a better installation of the Ubuntu operating system.
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
apt-cache policy docker-ce
sudo apt install docker-ce
sudo systemctl status docker
sudo usermod -aG docker ${USER}
su - ${USER}
groups
sudo usermod -aG docker username
docker run hello-world
Hello, world in the command line indicates that you've successfully installed Docker on your platform and successfully executed the command run.
In upcoming blogs, we are going to learn the basic Docker commands, what a Docker file is, how to create a Dockerfile, push it to the repository, implement CI CD pipeline so on. To not miss further blogs, please follow me and subscribe to my newsletter.