Docker is used to run software packages called containers. Containers are isolated from each other and bundle their own application, tools, libraries and configuration files; they can communicate with each other through well-defined channels. All containers are run by a single operating-system kernel and are thus more lightweight than virtual machines. Containers are created from images that specify their precise contents. Images are often created by combining and modifying standard images downloaded from public repositories. -- Wikipedia
Instructions for installing can be found at the Official Docker site. For detailed installation, see Docker docs.
There are a few methods to install docker
on Ubuntu.
-
Yum install Docker. Example:
sudo yum install docker
-
Start Docker. Example:
sudo systemctl start docker
-
Optional: Start Docker on reboot. Example:
sudo systemctl enable docker
-
Uninstall old docker. Example:
sudo yum remove docker docker-common docker-selinux docker-engine
-
sudo yum -y install yum-utils device-mapper-persistent-data lvm2 sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo sudo yum -y install docker-ce
-
Start Docker. Example:
sudo systemctl start docker
-
Optional: Start Docker on reboot. Example:
sudo systemctl enable docker
-
Fix for unable to prepare context.
Error seen:
unable to prepare context: unable to 'git clone' to temporary context directory: error initializing submodules: usage: git submodule
Fix:
sudo yum install https://centos7.iuscommunity.org/ius-release.rpm sudo yum swap git git2u
There a a few methods to install docker
on Ubuntu.
-
Apt install Docker. Example:
sudo apt install docker.io
-
Proceed to Test
-
sudo apt-get update sudo apt-get 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 \ $(lsb_release -cs) \ stable" sudo apt-get update sudo apt-get install docker-ce
-
Proceed to Test
-
Past version Example:
sudo apt-get update sudo apt -y install apt-transport-https ca-certificates curl software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo apt-get update sudo apt -y install docker.io
-
Proceed to Test
-
Install Docker Desktop for Mac
- Open Docker.dmg
- Drag Docker to Applications
-
Go to "Applications" and double-click on "Docker"
- Check the menu bar for the Docker icon
-
Test
- Open Terminal
docker --version docker-compose --version docker-machine --version docker run hello-world
-
Proceed to Test
- Caveat: Requires Windows Pro.
- Install Docker Desktop for Windows
- Run
Docker%20for%20%Windows%20Installer.exe
- Run
- Proceed to Test
-
Test
sudo docker --version sudo docker run hello-world