How can I quickly add a Docker container to a network proxy?

14 Replies, 1864 Views

Yo, I feel you! I was stuck on this too. Honestly, the simplest way is to use `--env` like you mentioned.

Here’s what I did:
`docker run --env HTTP_PROXY=http://proxy.example.com:8080 --env HTTPS_PROXY=http://proxy.example.com:8080 my-container`

If you’re using Docker Compose, you can add these vars in the `environment` section. Super easy and no need to rewrite anything.

Messages In This Thread



Users browsing this thread: 1 Guest(s)