Skip to content

Commit 065e2ec

Browse files
committed
add proxy for docker build and docker run
1 parent d5a66ea commit 065e2ec

3 files changed

+48
-0
lines changed

chtproxy-010-160-128-016.bash

+16
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,20 @@ if [ ! -f "/etc/systemd/system/docker.service.d/http-proxy.conf" ]; then
2929
sudo service docker restart
3030
sudo systemctl daemon-reload
3131
sudo systemctl restart docker
32+
# for docker build and docker run
33+
mkdir -p ~/.docker
34+
cat << END > ~/.docker/config.json
35+
{
36+
"proxies":
37+
{
38+
"default":
39+
{
40+
"httpProxy": "${CHT_PROXY}",
41+
"httpsProxy": "${CHT_PROXY}",
42+
"noProxy": "localhost,127.0.0.1"
43+
}
44+
}
45+
}
46+
END
47+
3248
fi

chtproxy-010-160-128-028.bash

+16
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,20 @@ if [ ! -f "/etc/systemd/system/docker.service.d/http-proxy.conf" ]; then
2929
sudo service docker restart
3030
sudo systemctl daemon-reload
3131
sudo systemctl restart docker
32+
# for docker build and docker run
33+
mkdir -p ~/.docker
34+
cat << END > ~/.docker/config.json
35+
{
36+
"proxies":
37+
{
38+
"default":
39+
{
40+
"httpProxy": "${CHT_PROXY}",
41+
"httpsProxy": "${CHT_PROXY}",
42+
"noProxy": "localhost,127.0.0.1"
43+
}
44+
}
45+
}
46+
END
47+
3248
fi

chtproxy.bash

+16
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,20 @@ if [ ! -f "/etc/systemd/system/docker.service.d/http-proxy.conf" ]; then
2929
sudo service docker restart
3030
sudo systemctl daemon-reload
3131
sudo systemctl restart docker
32+
# for docker build and docker run
33+
mkdir -p ~/.docker
34+
cat << END > ~/.docker/config.json
35+
{
36+
"proxies":
37+
{
38+
"default":
39+
{
40+
"httpProxy": "${CHT_PROXY}",
41+
"httpsProxy": "${CHT_PROXY}",
42+
"noProxy": "localhost,127.0.0.1"
43+
}
44+
}
45+
}
46+
END
47+
3248
fi

0 commit comments

Comments
 (0)