Skip to content

Instantly share code, notes, and snippets.

@dcode
Created January 11, 2016 02:42
Show Gist options
  • Select an option

  • Save dcode/8712c85b3975a924330c to your computer and use it in GitHub Desktop.

Select an option

Save dcode/8712c85b3975a924330c to your computer and use it in GitHub Desktop.
Use HTTP proxy on Atomic host from

Install tinyproxy

On Mac, install tinyproxy using Homebrew and disable access control (or modify for your environment), then spawn in foreground

brew install tinyproxy
gsed -i'' 's/^Allow /#Allow /' /usr/local/etc/tinyproxy.conf
tinyproxy -d

In another terminal, SSH to Atomic Host box and provide remote port forwarding.

ssh -R8888:127.0.0.1:8888 user@hostname

If everything was successful (after you've configured Docker via systemd from other gist file), you'll be able to use Docker to download containers via the HTTP host. To use the proxy to download other things using something like curl, just use the environment variables.

http_proxy=127.0.0.1:8888 curl http://something.com/great/resource.tar.gz
mkdir /etc/systemd/system/docker.service.d/
cat >/etc/systemd/system/docker.service.d/proxy.conf << EOF
[Service]
Environment=HTTP_PROXY=http://127.0.0.1:3128/
EOF
systemctl daemon-reload
systemctl restart docker.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment