
Docker is a set of platform as a service (PaaS) products that use OS-level virtualization to deliver software in packages called containers.
To install the latest version of the Docker Engine you need to set up the Docker repository and install the yum-utils package to enable Docker stable repository on the system.
# yum install -y yum-utils # yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo Now install the newer docker-ce version from the Docker repository and containerd manually, because due to some issues, Red Hat blocked the installation of containerd.io > 1.2.0-3.el7, which is a dependency of docker-ce. # yum install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm # yum install docker-ce docker-ce-cli After, Docker package has been installed, start the daemon, check its status and enable it system-wide using the below commands: # systemctl start docker # systemctl status docker # systemctl enable docker Finally, run a container test image to verify if Docker works properly, by issuing the following command: # docker run hello-world Docker commands ===================== # yum install -y yum-utils # yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo # yum install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm # yum install docker-ce docker-ce-cli # systemctl start docker # systemctl status docker # systemctl enable docker # docker run hello-world >>>>>>>Test # docker info # docker version # docker >>>> help # docker search ubuntu >>> search containers #docker pull ubuntu >>> its available in hub.docker.com #docker images # docker rm ubuntu >>> remove image #docker rename tecmint-web ami-web >>> renaming # docker run ubuntu cat /etc/issue # docker ps -l #docker ps -a >>>> for seeing all containers #docker start/stop/stats ami-web # docker run --name ubuntu20.04 ubuntu cat /etc/issue # docker run -it ubuntu bash # sudo docker run -dit --name ami-web -p 8080:80 -v /home/user/website/:/usr/local/apache2/htdocs/ httpd:2.4 >>> for apached web # vi /home/user/website/docker.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Apache from Docker </title> </head> <body> <h1>Its from Docker Apache</h1> </body> </html> #exit