This tutorial explains, how to install docker on Ubuntu.
Sep 30, 2020 Install Docker on Ubuntu Using Docker Official Repositories Let’s update the local repository and install prerequisite dependencies. $ sudo apt update $ sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common. Docker images typically do not have sudo, you are already running as root by default. Apt-get update && apt-get install -y build-essential curl git libfreetype6-dev libpng12-dev libzmq3-dev pkg-config python-dev python-numpy python-pip software-properties-common swig zip zlib1g-d.
Docker is a platform that combines applications and its dependencies in the form of packages called a container. We can run multiple containers on a single Operating System. Containers are not Virtual Machines. Virtual Machines requires Operating System to run applications, but containers do not. As containers don’t need an Operating System, it takes very little time to start and hence it is very faster than Virtual Machines.
Read About: How to Install Docker on Windows
&& How to install Ansible on Ubuntu
Step 1- Update your Ubuntu Linux Box.
$ sudo apt-get update -y
Step 2 – Download and run a get-docker.sh script to install docker.
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh
or you can Download and run Test Script.
Download and run testing version, download and install test-docker.sh script using the following commands.
$ curl -fsSL https://get.docker.com -o test-docker.sh
$ sudo sh test-docker.sh
Step 3- Add a user to the Docker group.
If you would like to use Docker with a non-root user, using the following command.
Add a new user docker-user and set a password
$ sudo useradd docker-user
$ sudo passwd docker-user
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Add docker-user to Docker group
$ sudo usermod -aG docker docker-user
Step 4 – Check Docker Version
Check Docker Version using the following command
$ docker – -version
Docker version 19.03.8, build afacb8b7f0
Use the following command to uninstall docker completely, including Docker Engine, CLI and Containerd Package
$ sudo apt-get purge docker-ce docker-ce-cli containerd.io -y
Also delete all Docker Images, Containers, and Volumes that not automatically remove.
$ sudo rm -rf /var/lib/docker
Note: If you install docker using the script, you should update the docker using the package manager only. Don’t re-run docker script, as it can cause issues if it attempts to re-add repositories.
I hope you enjoyed this tutorial and learned about “How to install Docker on Ubuntu using Script”. If you think this is really helpful, please do share this article with others as well. Please also share your valuable feedback, comment, or any query in the comment box. I will really happy to resolve your all queries any.
If you think we helped you or just want to support us, please consider these:-
Connect to us: FacebookTwitter