Getting Docker for mac proxy variables through terminal

Viewed 1000

I am using Docker for mac behind a proxy. I set up the proxy configuration in the Docker GUI under "Proxies" -> "Manual proxy configuration". This lets me download Docker images from the repository behind the proxy.

Next, I set the http_proxy and https_proxy environment variables and I use them in my docker-compose.yml to pass them to the build:

services:
  app:
    build:
      context: .
      args:
        http_proxy: $http_proxy
        https_proxy: $https_proxy

How can I get the variables that I set through the Docker GUI in the terminal so I don't have to set them twice? Are there any Docker-specific environment variables that I can use?

4 Answers
Related