參考官方文檔進行,位址如下:
<a href="https://docs.docker.com/engine/userguide/storagedriver/device-mapper-driver/#configure-docker-with-the-devicemapper-storage-driver" target="_blank">https://docs.docker.com/engine/userguide/storagedriver/device-mapper-driver/#configure-docker-with-the-devicemapper-storage-driver</a>
1、解除安裝老版本
2、設定REPOSITORY
yum install -y yum-utils device-mapper-persistent-data lvm2
3、啟動extras額外的依賴庫
yum-config-manager --enable extras
4、設定docker穩定的源
sudo yum-config-manager \
--add-repo \
5、啟動docker.repo源
yum-config-manager --enable docker-ce-edge
1、更新yum的安裝索引
yum makecache fast
2、展示yum裡能夠提供的docker-ce的版本
yum list docker-ce.x86_64 --showduplicates |sort -r
3、安裝docker版本
yum -y install docker-ce-17.03.1.ce
4、編輯/etc/docker/daemon.json,建立或者添加如下:
{
"storage-driver": "devicemapper"
}
5、官方推薦生産環節配置direct-lvm,配置步驟如下:
<a href="https://docs.docker.com/engine/userguide/storagedriver/device-mapper-driver/#configure-direct-lvm-mode-for-production" target="_blank">https://docs.docker.com/engine/userguide/storagedriver/device-mapper-driver/#configure-direct-lvm-mode-for-production</a>
6、啟動docker
systemctl start docker
7、啟動一個容器測試
docker run hello-world
#出現如下及安裝成功
Hello from Docker!
This message shows that your installation appears to be working correctly.
本文轉自Mr_chen 51CTO部落格,原文連結:http://blog.51cto.com/metis/1945271,如需轉載請自行聯系原作者