Giving a proxy to docker using polipo in ubuntu

0. Make sure you have shadowsocks running in the background
https://yingshaoxo.blogspot.com/2017/07/bypass-great-firewall-by-using.html


1. First, set a http_proxy

`sudo apt install polipo`

`sudo vim /etc/polipo/config`

add following and save it:
```
proxyAddress = "0.0.0.0"
proxyPort = 1088

socksParentProxy = "localhost:1080"
socksProxyType = socks5
```

`sudo service polipo restart`

Now you got a http_proxy at localhost:1088.


2. Give that proxy to docker

`sudo vim /etc/default/docker`

add or change to `export http_proxy="localhost:1088/"`

`sudo service docker restart`