Docker 安装
系统版本: CentOS Linux release 7.5.1804 (Core)
如果之前有装过 docker 可以先卸载旧版本再安装, 没有则跳过.
yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
安装软件包:
yum install -y yum-utils device-mapper-persistent-data lvm2
设置镜像仓库:
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
安装 docker:
yum install -y docker-ce docker-ce-cli containerd.io
启动 docker:
systemctl start docker
可以进行测试:
- # docker run hello-world
- Unable to find image 'hello-world:latest' locally
- latest: Pulling from library/hello-world
- 1b930d010525: Pull complete
- Digest: sha256:fc6a51919cfeb2e6763f62b6d9e8815acbf7cd2e476ea353743570610737b752
- 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 from the Docker Hub.
- (amd64)
- 3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
- 4. The Docker daemon streamed that output to the Docker client, which sent it
- to your termi
来源: http://www.bubuko.com/infodetail-3448366.html