Skip to content

Commit 904c0b8

Browse files
authored
add mitmproxy usage to Docker
1 parent da81cf6 commit 904c0b8

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Diff for: Docker.md

+23
Original file line numberDiff line numberDiff line change
@@ -1347,3 +1347,26 @@ Environment="NO_PROXY=localhost,127.0.0.1,docker-registry.example.com,.corp"
13471347
# systemctl reload docker
13481348
```
13491349

1350+
## 使用mitmproxy观察docker pull流量
1351+
1352+
```
1353+
wget https://downloads.mitmproxy.org/10.4.2/mitmproxy-10.4.2-linux-x86_64.tar.gz
1354+
tar xvf mitmproxy-10.4.2-linux-x86_64.tar.gz
1355+
./mitmweb -p 8441 --no-web-open-browser --web-port 18441 --web-host 0.0.0.0 --set block_global=false
1356+
cp ~/.mitmproxy/mitmproxy-ca-cert.cer /usr/share/ca-certificates/extra
1357+
echo "extra/mitmproxy-ca-cert.cer" >> /etc/ca-certificates.conf
1358+
update-ca-certificates
1359+
vi /etc/systemd/system/docker.service.d/http-proxy.conf
1360+
systemctl daemon-reload
1361+
systemctl restart docker
1362+
```
1363+
1364+
`http-proxy.conf` 文件内容
1365+
1366+
```
1367+
[Service]
1368+
Environment="HTTP_PROXY=http://127.0.0.1:8441"
1369+
Environment="HTTPS_PROXY=http://127.0.0.1:8441"
1370+
```
1371+
1372+
然后打开 `http://IP:18441` , 执行 docker pull 命令即可

0 commit comments

Comments
 (0)