欢迎光临
我们一直在努力

[Centos7]安装Docker

Yum安装

<span class="pln">sudo yum install </span><span class="pun">-</span><span class="pln">y yum</span><span class="pun">-</span><span class="pln">utils device</span><span class="pun">-</span><span class="pln">mapper</span><span class="pun">-</span><span class="pln">persistent</span><span class="pun">-</span><span class="pln">data lvm2
sudo yum</span><span class="pun">-</span><span class="pln">config</span><span class="pun">-</span><span class="pln">manager </span><span class="pun">--</span><span class="pln">add</span><span class="pun">-</span><span class="pln">repo https</span><span class="pun">:</span><span class="com">//download.docker.com/linux/centos/docker-ce.repo</span>
<span class="com">#sudo yum-config-manager --enable docker-ce-edge</span>
<span class="com">#sudo yum-config-manager --disable docker-ce-edge</span>
<span class="com">#查看可使用的版本</span><span class="pln">
yum list docker</span><span class="pun">-</span><span class="pln">ce </span><span class="pun">--</span><span class="pln">showduplicates </span><span class="pun">|</span><span class="pln"> sort </span><span class="pun">-</span><span class="pln">r
</span><span class="com">#安装指定版本</span><span class="pln">
sudo yum install docker</span><span class="pun">-</span><span class="pln">ce</span><span class="pun">-<</span><span class="pln">VERSION STRING</span><span class="pun">></span>
<span class="com">#安装最新版本</span><span class="pln">
sudo yum install docker</span><span class="pun">-</span><span class="pln">ce
</span><span class="com">#启动docker</span><span class="pln">
sudo systemctl start docker
</span><span class="com">#Hello World</span><span class="pln">
sudo docker run hello</span><span class="pun">-</span><span class="pln">world</span>

下载安装

<span class="com">#下载地址:https://download.docker.com/linux/centos/7/x86_64/stable/Packages/</span><span class="pln">
sudo yum install xxxxx</span><span class="pun">.</span><span class="pln">rpm
sudo systemctl start docker
sudo docker run hello</span><span class="pun">-</span><span class="pln">world</span>
赞(0)
未经允许不得转载:798VPS » [Centos7]安装Docker
分享到: 更多 (0)