command line

  • Start the container with the -e flag, which allows you to set environment variables inside the container.

  • Set the HTTP_PROXY and HTTPS_PROXY environment variables to the URL of the external proxy.

1
docker run -e HTTP_PROXY=http://myproxy.com:8080 -e HTTPS_PROXY=http://myproxy.com:8080 my-browser

docker-compose.yml

Set the environment variable for the service to include the HTTP_PROXY and HTTPS_PROXY variables, set to the URL of the external proxy.

1
2
3
4
5
6
services:
my-browser:
image: my-browser
environment:
HTTP_PROXY: '192.168.100.1:7890'
HTTPS_PROXY: '192.168.100.1:7890'

config in browser (in container)

1
192.168.100.1:7890