Docker Installation
Ubuntu
Using apt-get
This approach will also install docker-compose.
Remove old installations
sudo apt-get remove docker docker-engine docker.io containerd runc
Setup repo
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
Install docker engine
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
Verify Docker install
sudo docker run hello-world
Run docker as non-root
sudo groupadd docker
sudo usermod -aG docker $USER
Now logout and login again to use docker.
Configure docker to run on system startup:-
sudo systemctl enable docker
Using snap package (snap should be pre-installed). This will install docker and start daemon
sudo snap install docker
Verify docker process
# Verify docker process
ps -ef|grep docker
# Check docker version
docker --version
We need to install docker-compose separately here. Please follow this link for docker-compose.