<docker series> centos install docker

content:

1. Installation conditions

2. Basic environment of virtual machine

3. Install docker

4. Errors and handling during use

 

1. Installation conditions

Docker currently only runs on computers with 64-bit CPU architecture (currently only x86_64, amd64).

The linux kernel version must be 2.6.32-431 or higher

 

2. Basic environment of virtual machine

64-bit centos6.5, VMware10.0.0

1. Install centos6.5 in the virtual machine

2. Update the software package

[root@localhost~]# yum update

3. Check the kernel and centos version

[root@localhost~]# uname –r

[root@localhost~]# cat /etc/redhat-release

 

3. Install docker

1. Use the yum command to install

(Note: Please make sure you have root related permissions)

2. Create yum.repo

tee/etc/yum.repos.d/docker.repo <<-'EOF'

[dockerrepo]

name=DockerRepository

baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/

enabled=1

gpgcheck=1

gpgkey=https://yum.dockerproject.org/gpg

EOF

3. Install the docker package

yuminstall docker-engine

4. Start the docker service

service dockerstart

5. Run hello-world to make sure docker is installed successfully

6. Create a docker user

[root@localhost/]# useradd -g docker docker

[root@localhost/]# passwd docker

[root@localhost/]# usermod -aG docker docker

[docker@localhost/]$ docker run hello-world

(Mainly for security reasons, since the docker daemon binds the socker port. By default, the port is owned by the root user. So based on this situation, the docker daemon runs as the root user)

 

4. Errors and handling during use

1. Error using docker command


Remedy: The docker service is not enabled. Enable to handle this error

2. Start docker normally, the server crashes; after restarting the server, the following error occurs when starting docker


Process: rm -rf /var/lib/docker/

Before deleting, important things should be backed up

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325647938&siteId=291194637