I'm having a peculiar issue. When I make requests running my script on my local machine and go through the (paid and authenticated) proxy, it runs just fine. However, when I containerize the application and attempt to run again, I get the following error:
File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 513, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.myawesomesite.com', port=443): Max retries exceeded with url: /my-url/model?opname=metadata (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required')))
Let me emphasize my python code is exactly the same, including when it comes to retrieving and utilizing the proxy credentials. The weird thing is that I've been running this same technique for over a year now but now seeing this issue all of a sudden. Is there something different about the way that Docker authenticates to proxies? Anyone have ideas what's causing the problem?
For reference here's my the gist of my DockerFile:
FROM python:3.7.5-slim
WORKDIR /usr/src/app
RUN python3 -m pip install \
requests \
mysql-connector \
pymongo \
numpy \
dnspython \
simple_watchdog_timer
COPY myScript1.py .
COPY mySupportingModule1.py .
ENTRYPOINT ["python3", "myScript1.py"]