Docker CentOS installation

Docker CentOS version supports the following:

  • CentOS 7 (64-bit)
  • CentOS 6.5 (64-bit) or later

Prerequisites

Currently, CentOS kernel supports only the release of Docker.

Docker running on CentOS 7, the system of claim 64, kernel version 3.10 or more.

Docker running on CentOS-6.5 or higher version of the CentOS, requires 64-bit system, the system kernel version or higher 2.6.32-431

Using yum installation (CentOS 7 below)

Docker system requirements CentOS kernel version higher than 3.10, see this page prerequisite to verify your CentOS version supports Docker.

By  uname -r  to see your current kernel version command

[root@localhost /]# uname -r

Installation Docker

From March 2017 began docker is divided into two branches on the basis of the original version: Docker CE and Docker EE.

Docker CE community that is free version, Docker EE namely Enterprise Edition, emphasis on security, but need to pay to use.

This article describes the installation Docker CE.

Remove the old version:

$ yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-selinux \
                  docker-engine-selinux \
                  docker-engine

Install some necessary system tools:

 yum install -y yum-utils device-mapper-persistent-data lvm2

Add the software source information:

 yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

Update yum cache:

 yum makecache fast

Installation Docker-ce:

 yum -y install docker-ce

Docker start background service

 systemctl start docker

Hello-world test run

[root@localhost /]# docker run hello-world

 

 

Eggs:

Use [root @ localhost /] # docker run hello-world command error

[root@localhost /]# docker run hello-world Unable to find image 'hello-world:latest' locally docker: Error response from daemon: Get https://registry-1.docker.io/v2/library/hello-world/manifests/latest:

You can try turn off the firewall

Check the status of the firewall:

[root@localhost ~]# systemctl list-unit-files|grep firewalld.service

Turn off the firewall:

 

 # Stop firewall

[root@localhost ~]# systemctl stop firewalld.service       

# Disable firewall boot

[root@localhost ~]# systemctl disable firewalld.service     

 

Guess you like

Origin blog.csdn.net/lm9521/article/details/89792956
Recommended