Blame

24f25c Qwas 2024-10-29 15:38:36 1
# Docker 使用
25daf1 Qwas 2024-06-09 14:39:46 2
24f25c Qwas 2024-10-29 15:38:36 3
## 安装 Docker 程序
4
5
```sh
6
curl -fsSL https://get.docker.com -o get-docker.sh
7
sudo DOWNLOAD_URL=https://mirrors.aliyun.com/docker-ce sh get-docker.sh
8
```
9
10
[ustc docker 文档](https://mirrors.ustc.edu.cn/help/docker-ce.html)
11
12
## 为 Docker 守护进程配置代理
25daf1 Qwas 2024-06-09 14:39:46 13
14
```sh
15
vi /etc/docker/daemon.json
16
```
17
18
```json
19
{
20
"proxies": {
21
"http-proxy": "http://127.0.0.1:7890",
22
"https-proxy": "http://127.0.0.1:7890",
23
"no-proxy": "*.aliyun.com,*.*.aliyuncs.com,127.0.0.0/8"
24
}
25
}
26
```
27
24f25c Qwas 2024-10-29 15:38:36 28
> 配置后重启 docker
29
30
```sh
31
sudo systemctl restart docker
32
```
33
25daf1 Qwas 2024-06-09 14:39:46 34
参考链接
35
36
[Configure the Docker daemon to use a proxy server](https://docs.docker.com/config/daemon/systemd/#httphttps-proxy)
37
38
[Configure the Docker daemon](https://docs.docker.com/config/daemon/#configure-the-docker-daemon)