Docker alternative for Python to Nodejs for Proxy Ins

Viewed 20
RUN npm config set https-proxy http://proxy.company.com:8080

The above line is for the NodeJs format in the Docker File

I am looking for an alternative to the above syntax in Python

ENV https-proxy http://proxy.company.com:8080

Will this work ?

1 Answers

If you do that in your dockerfile then you should be able to access the environment variable in python using the code:

import os

proxy = os.environ["https-proxy"]

If that's sufficient, you're done. If you need to do something else with it we'd need more information about your goal.

Related