安装docker --linux
https://docs.docker.com/engine/installation/linux/centos/
curl -fsSL https://test.docker.com/ | sh
Install with the script
-
Log into your machine as a user with
sudo
orroot
privileges. -
Make sure your existing packages are up-to-date.
$ sudo yum update
-
Run the Docker installation script.
$ curl -fsSL https://get.docker.com/ | sh
This script adds the
docker.repo
repository and installs Docker. -
Enable the service.
$ sudo systemctl enable docker.service
-
Start the Docker daemon.
$ sudo systemctl start docker
-
Verify
docker
is installed correctly by running a test image in a container.$ sudo docker run hello-world
问题1:
解决办法:需要启动下docker的服务
$ sudo systemctl enable docker.service
$ sudo systemctl start docker