Docker requires a 64-bit installation regardless of your CentOS version. Also, your kernel must be 3.10 at minimum, which CentOS 7 runs. 要求centos7 64-bit
1
uname -r
我的是CentOS7,3.10.0-229.el7.x86_64,符合要求
用脚本安装
yum package最新
1
sudo yum update
Run the Docker installation script.
1
curl -sSL https://get.docker.com/ | sh
This script adds the docker.repo repository and installs Docker.
Start the Docker daemon.
1
sudo service docker start
失败了,提示Job for docker.service failed. See 'systemctl status docker.service' and 'journalctl -xn' for details. 查了一下,#15498有人说要装docker-selinux
Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 535020c3e8ad: Pull complete af340544ed62: Already exists library/hello-world:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied ontoprovidesecurity. Digest: sha256:d5fbd996e6562438f7ea5389d7da867fe58e04d581810e230df4cc073271ea52 Status: Downloaded newer image for hello-world:latest
Hello from Docker. This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the"hello-world" image fromthe Docker Hub. 3. The Docker daemon created anew container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output tothe Docker client, which sent it to your terminal.
To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash
Share images, automate workflows, and more witha free Docker Hub account: https://hub.docker.com
For more examples and ideas, visit: https://docs.docker.com/userguide/