Unable to install packages from pip host in Docker Container

Unable to install packages from pip host in Docker Container

RUN pip install --extra-index-url http://[pip host]/simple/ --trusted-host [pip host] -r requirements.txt

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connectio
n.HTTPConnection object at 0x7f4a88f977b8>, 'Connection to [pip host] timed out. (connect timeout=15)')': /simple/[package]/
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connectio
n.HTTPConnection object at 0x7f4a88f91978>, 'Connection to [pip host] timed out. (connect timeout=15)')': /simple/[package]/
  WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connectio
n.HTTPConnection object at 0x7f4a88fa1ef0>, 'Connection to [pip host] timed out. (connect timeout=15)')': /simple/[package]/

Source: StackOverflow