Outbound HTTPS from containers works only through a corporate proxy.
IntermediateScenarioNetworking and Compose
Answer
Situation read → Build and runtime need proxy settings; daemon pulls need them separately.
What I'd do →
- Client side:
~/.docker/config.json"proxies": {"default": {"httpProxy": "...", "noProxy": "..."}}injects env vars into containers and builds. - Daemon pulls: systemd drop-in
Environment="HTTPS_PROXY=..."fordocker.service. - Install the corporate CA into base images.
Why → The daemon, build containers and runtime containers are three separate places.
Interview tip → Do not bake proxy settings into images.
More on Networking and Compose
Containers on the default bridge cannot resolve each other by name. Why, and what do you do?BeginnerHow do you expose a container only to the local host, not the internet?BeginnerDesign a Compose file for web + api + postgres + redis with correct startup ordering.IntermediateFrontend must reach the API but not the database. Segment the network.IntermediateA container needs to call a service running on the Docker host.BeginnerWhen would you use `--network host`?Intermediate