docker通过代理配置上网无法pull anbox
使用代理配置文件解决
1. 创建代理配置文件
运行以下命令创建配置文件:
sudo mkdir -p /etc/systemd/system/docker.service.d
sudo touch /etc/systemd/system/docker.service.d/http-proxy.conf
2. 编辑配置文件
使用nano文本编辑器打开文件:
sudo nano /etc/systemd/system/docker.service.d/http-proxy.conf
3. 写入代理配置
(1)在文件中添加以下内容,替换 [proxy-addr]
和 [proxy-port]
为你的实际代理地址和端口:
[Service]
Environment="HTTP_PROXY=http://[proxy-addr]:[proxy-port]/"
Environment="HTTPS_PROXY=http://[proxy-addr]:[proxy-port]/"
Environment="NO_PROXY=localhost,127.0.0.1"
(2)进入 Clash 的配置目录,查看 config.yaml
文件:
sudo nano /etc/clash/config.yaml
得到例如如下信息:
port: 7890
socks-port: 7891
redir-port: 7892
mixed-port: 7893
allow-lan: false
mode: Rule
log-level: info
ipv6: true
hosts: null
dns:
enable: true
ipv6: true
listen: '0.0.0.0:1053'
use-hosts: true
default-nameserver: [119.29.29.29, 8.8.8.8, 1.1.1.1]
nameserver: [223.5.5.5, 119.29.29.29]
fake-ip-range: 198.18.0.1/16
fake-ip-filter: ['*.lan', '*.localdomain', '*.example', '*.invalid', '*.localhost', '*.test', '*.local', '*.home.>
external-controller: '127.0.0.1:9090'
clash-for-android:
append-system-dns: false
proxies:
- { name: '
标签:Get,0.1,tcp,Environment,proxy,https,docker,port,PROXY
From: https://blog.csdn.net/m0_74363214/article/details/143065275