泡泡蛋先生 發表於 2020-3-4 21:50:00

debian安装docker

<h2 id="支持的系统版本">支持的系统版本</h2>
<ul>
<li>Buster 10</li>
<li>Stretch 9 (stable) / Raspbian Stretch</li>
</ul>
<h2 id="删除旧版本">删除旧版本</h2>
<pre><code>$ sudo apt-get remove docker docker-engine docker.io containerd runc
</code></pre>
<h2 id="安装docker-engine社区版">安装Docker Engine社区版</h2>
<h3 id="设置apt仓库">设置apt仓库</h3>
<h4 id="1-更新apt包索引">1. 更新<code>apt</code>包索引:</h4>
<pre><code>$ sudo apt-get update
</code></pre>
<h4 id="2-安装一些包让apt支持https">2. 安装一些包让<code>apt</code>支持https:</h4>
<pre><code>$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg2 \
    software-properties-common
</code></pre>
<h4 id="3-添加docker光放gpg-key">3. 添加Docker光放GPG key:</h4>
<pre><code>$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
$ sudo apt-key fingerprint 0EBFCD88

pub   4096R/0EBFCD88 2017-02-22
      Key fingerprint = 9DC8 5822 9FC7 DD38 854AE2D8 8D81 803C 0EBF CD88
uid                  Docker Release (CE deb) &lt;docker@docker.com&gt;
sub   4096R/F273FCD8 2017-02-22
</code></pre>
<h4 id="4-添加docker源">4. 添加Docker源:</h4>
<pre><code>$ sudo add-apt-repository \
   "deb https://download.docker.com/linux/debian \
   $(lsb_release -cs) \
   stable"
</code></pre>
<h3 id="安装docker社区版">安装Docker社区版</h3>
<h4 id="1-更新apy包索引">1. 更新<code>apy</code>包索引:</h4>
<pre><code>$ sudo apt-get update
</code></pre>
<h4 id="2-安装">2. 安装:</h4>
<pre><code>$ sudo apt-get install docker-ce docker-ce-cli containerd.io
</code></pre>
<h2 id="安装docker-compose可选">安装docker-compose(可选)</h2>
<h4 id="1-下载">1. 下载:</h4>
<pre><code>sudo curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
</code></pre>
<h4 id="2-增加可执行权限">2. 增加可执行权限:</h4>
<pre><code>sudo chmod +x /usr/local/bin/docker-compose

</code></pre>
<h2 id="配置镜像站">配置镜像站</h2>
<blockquote>
<p>daocloud 提供了一个一键配置镜像的脚本</p>
</blockquote>
<pre><code># 命令行最后面的网址可以换成别的镜像站,如腾讯: https://mirror.ccs.tencentyun.com
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io
</code></pre><br><br>
来源:https://www.cnblogs.com/xzhuo/p/12416298.html
頁: [1]
查看完整版本: debian安装docker