You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
728 B
28 lines
728 B
|
4 years ago
|
```
|
||
|
|
$ sudo curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
|
||
|
|
```
|
||
|
|
将当前用户加入docker组
|
||
|
|
``` shell
|
||
|
|
$ sudo usermod -aG docker <用户名>
|
||
|
|
```
|
||
|
|
> 假如当前用户为`ubuntu`,则实际运行的命令为`sudo usermod -aG docker ubuntu`
|
||
|
|
|
||
|
|
然后退出终端,重新进入以刷新docker权限
|
||
|
|
|
||
|
|
由于国内网络原因,默认的docker源访问速度非常缓慢,因此更换为阿里云的镜源
|
||
|
|
|
||
|
|
新建配置文件
|
||
|
|
```
|
||
|
|
$ sudo vim /etc/docker/daemon.json
|
||
|
|
```
|
||
|
|
将下方内容粘贴到新建的文件,并保存
|
||
|
|
``` json
|
||
|
|
{
|
||
|
|
"registry-mirrors": ["https://oxkrityz.mirror.aliyuncs.com"],
|
||
|
|
"live-restore": true
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
*到这里准备工作已经完成,接下来将重启系统。*
|
||
|
|
```
|
||
|
|
sudo reboot
|