全部博文(150)
分类: 系统运维
2017-03-23 18:40:07
本文暂不介绍,抱歉。
yum install -y epel-release
yum install -y privoxy
[root@localhost ss]# cat /etc/privoxy/config |grep -v "#" confdir /etc/privoxy logdir /var/log/privoxy filterfile default.filter logfile logfile listen-address 127.0.0.1:8118 ##privoxy 监听端口 ,https proxy要指向这里 toggle 1 enable-remote-toggle 0 enable-remote-http-toggle 0 enable-edit-actions 0 enforce-blocks 0 buffer-limit 4096 enable-proxy-authentication-forwarding 0 forward-socks5 / 127.0.0.1:1080 . ## 实际的sslocal监听地址和端口 forwarded-connect-retries 0 accept-intercepted-requests 0 allow-cgi-request-crunching 0 split-large-forms 0 keep-alive-timeout 5 tolerate-pipelining 1 socket-timeout 300
vi /etc/sysconfig/docker 增加以下两行 HTTPS_PROXY= HTTP_PROXY= 保存退出 并重启docker systemctl restart docker
[root@localhost ~]# vi /etc/systemd/system/docker.service.d/http-proxy.conf
[Service] Environment="HTTPS_PROXY=" "HTTP_PROXY=" "NO_PROXY=localhost,127.0.0.1,reg.goluk.cn"
8118 为 privoxy监听端口,收到docker的pull请求会自动转发到socks5的1080端口,由sslocal通过ss server进行加速; reg.goluk.cn 为本地私有仓库,无需加速;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px Helvetica; -webkit-text-stroke: #000000}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier; -webkit-text-stroke: #000000; background-color: #f8f8f8}
span.s1 {font-kerning: none}
[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl show --property=Environment docker Environment=HTTPS_PROXY= HTTP_PROXY= NO_PROXY=localhost,127.0.0.1,reg.goluk.cn
[root@localhost ~]# systemctl restart docker