Docker安裝-yum安裝
阿新 • • 發佈:2018-12-08
準備環境
- 作業系統:CentOS 7.6 64位
- 參考資料:Docker幫助文件
安裝docker-ce
安裝必須包:
[[email protected] ~]# yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
配置docker-ce yum源:
[[email protected] ~]# yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo
載入yum源:
[[email protected] ~]# yum clean all
[[email protected] ~]# yum makecache
安裝docker-ce:
[[email protected] ~]# yum install -y docker-ce
配置docker開機自動啟動:
[[email protected] ~]# systemctl enable docker
啟動docker:
[[email protected] ~]# systemctl start docker
檢視docker狀態:
[[email protected] ~]# systemctl status docker
驗證docker是否安裝成功:
[[email protected] ~]# docker run hello-world
注意:
出現以下程式碼,表示安裝成功
Hello from Docker!
This message shows that your installation appears to be working correctly.