~/.docker/config.json
in thehome directory of the user which starts containers. Add JSON such as thefollowing, substituting the type of proxy with httpsProxy
or ftpProxy
ifnecessary, and substituting the address and port of the proxy server. Youcan configure multiple proxy servers at the same time.noProxy
key to one or more comma-separated IPaddresses or hosts. Using the *
character as a wildcard is supported, asshown in this example.--env
flag when you create or run thecontainer, you can set one or more of the following variables to the appropriatevalue. This method makes the image less portable, so if you have Docker 17.07or higher, you should configure the Docker clientinstead.Variable | Dockerfile example | docker run Example |
---|---|---|
HTTP_PROXY | ENV HTTP_PROXY='http://127.0.0.1:3001' | --env HTTP_PROXY='http://127.0.0.1:3001' |
HTTPS_PROXY | ENV HTTPS_PROXY='https://127.0.0.1:3001' | --env HTTPS_PROXY='https://127.0.0.1:3001' |
FTP_PROXY | ENV FTP_PROXY='ftp://127.0.0.1:3001' | --env FTP_PROXY='ftp://127.0.0.1:3001' |
NO_PROXY | ENV NO_PROXY='*.test.example.com,.example2.com' | --env NO_PROXY='*.test.example.com,.example2.com' |
ssh -D 8080 -f -C -N ${remote-host}
, it made more sense to setup the port forwarding in ~/.ssh/config
and create a couple aliases that allowed us to quickly start/check/exit the tunnel.~/.ssh/config
file:IdentityFile
as needed.x.x.x.x
with the desired IP address, most likely a jumphost.admin-user
with the desired user.8080
, but your needs may differ.~/.ssh/sockets
directory if it does not already exist.~/.bash_profile
:localhost
, port 8080
. If you are using the SwitchyOmega extension, it will look like the following:proxy-on
) and the auto switch rule in place, all you need to do is go to the desired URL.