Objectives
- Install Docker on CentOS Linux 7
- Verify Docker installation
- Start and enable Docker Engine
Prerequisites
- 64-bit CentOS Linux 7
Sequence 1. Installing Docker
- Old version of Docker packages are available in the official repository of CentOS. Login as root user and remove old version, if installed.
# yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine
- Install Yum Utils
# yum install -y yum-utils
- Configure Latest Docker Repository
# yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo
- Install Latest version of Docker
# yum install -y docker-ce docker-ce-cli containerd.io
- After installation is complete, start the Docker daemon:
# systemctl start docker
- Verify that it’s running and, make sure it starts at every server reboot:
# systemctl status docker # systemctl enable docker
- The output should be similar to the following, showing that the service is active and running:
Sequence 2. Verify Docker Installation
Using docker consists of passing it a chain of options and subcommands followed by arguments. The syntax is: docker [option] [command] [arguments]
- To view all available subcommands, type:
# docker
- To view the switches available to a specific command, type:
# docker docker-subcommand --help
- To view system-wide information, use:
# docker info https://youtu.be/HH4bQhHaxII