Docker:修订间差异

来自Gea-Suan Lin's Wiki
跳到导航 跳到搜索
此页面具有访问限制。如果您看见此消息,则说明您没有权限访问此页面。
无编辑摘要
第4行: 第4行:


 可以用這個一行指令直接安裝:
 可以用這個一行指令直接安裝:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -; sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"; sudo apt update; sudo apt install -y docker-ce
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -; sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"; sudo apt update; sudo apt install -y docker-ce
</syntaxhighlight>
另外可以加裝docker-compose:
<syntaxhighlight lang="bash">
sudo apt install -y docker-compose
</syntaxhighlight>
</syntaxhighlight>



2020年11月25日 (三) 22:01的版本

Docker是一套提供容器(英语:Container)的软件。

安装

可以用这个一行指令直接安装:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -; sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"; sudo apt update; sudo apt install -y docker-ce

另外可以加装docker-compose:

sudo apt install -y docker-compose

范例

启动一个简单的Ubuntu环境:

docker run -i -t --rm ubuntu:latest /bin/bash

然后把APT的服务器换掉:

perl -pi -e 's/archive.ubuntu.com/tw.archive.ubuntu.com/g' /etc/apt/sources.list
apt update -y

装些简单的东西:

apt install -y curl vim-nox wget

外部链接