title: How to make docker container connect everything through proxy
body: <p>I know it is possible to pass http_proxy and https_proxy environment variables to a container as shown in eg. <a href="https://stackoverflow.com/a/47828827/234466">this SO answer</a>. However, this only works for proxy-aware commands like wget and curl as they merely read and use these environment variables.</p>
  <p>I need to connect everything through the proxy, so that all internet access is routed via the proxy. Essentially, the proxy should be transformed into a kind of VPN.</p>
  <p>I am thinking about something similar to the <code>--net=container</code> option where the container gets its network from another container.</p>
  <p>How do I configure a container to run everything through the proxy?</p>