title: --extra-index-url is not working in docker file
body: <p>I have setup local pypiserver using following docker-compose.yml and it is working when i use it directly like</p>
  <p><code>pip install -r requirements.txt --extra-index-url http://127.0.0.1:8082</code></p>
  <p>However, When I try to use same command in Dockerfile, it is not working. Files I have created following files:</p>
  <p><strong>Dockerfile:</strong></p>
  <pre><code>FROM python:3
  ENV PYTHONUNBUFFERED=1
  ARG PIP_EXTRA_INDEX_URL
  WORKDIR /code
  COPY requirements.txt /code/
  RUN echo &quot;${PIP_EXTRA_INDEX_URL}&quot;
  RUN pip install -r requirements.txt $PIP_EXTRA_INDEX_URL
  COPY . /code/
  </code></pre>
  <p><strong>docker-compose.yml</strong></p>
  <pre><code>version: &quot;3.9&quot;
  
  services:
    db:
      image: postgres
      volumes:
        - ./data/db:/var/lib/postgresql/data
      environment:
        - POSTGRES_DB=postgres
        - POSTGRES_USER=postgres
        - POSTGRES_PASSWORD=postgres
    web:
      build:
        context: .
        args:
          - PIP_EXTRA_INDEX_URL=http://127.0.0.1:8082/simple/
      command: python manage.py runserver 0.0.0.0:8000
      volumes:
        - .:/code
      ports:
        - &quot;8800:8000&quot;
      depends_on:
        - db
  </code></pre>
  <p>When I try to run <code>docker-compose up</code>
  I am getting following errors:</p>
  <pre><code>Looking in indexes: https://pypi.org/simple, http://127.0.0.1:8082/simple/
  Collecting http://127.0.0.1:8082/simple/
    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('&lt;pip._vendor.urllib3.connection.HTTPConnection object at 0x7f7407596df0&gt;: Failed to establish a new connection: [Errno 111] Connection refused')': /simple/
    WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('&lt;pip._vendor.urllib3.connection.HTTPConnection object at 0x7f7407596b20&gt;: Failed to establish a new connection: [Errno 111] Connection refused')': /simple/
    WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('&lt;pip._vendor.urllib3.connection.HTTPConnection object at 0x7f74089dcf70&gt;: Failed to establish a new connection: [Errno 111] Connection refused')': /simple/
    WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('&lt;pip._vendor.urllib3.connection.HTTPConnection object at 0x7f74089dca60&gt;: Failed to establish a new connection: [Errno 111] Connection refused')': /simple/
    WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('&lt;pip._vendor.urllib3.connection.HTTPConnection object at 0x7f74089dcdf0&gt;: Failed to establish a new connection: [Errno 111] Connection refused')': /simple/
  ERROR: Could not install packages due to an OSError: HTTPConnectionPool(host='127.0.0.1', port=8082): Max retries exceeded with url: /simple/ (Caused by NewConnectionError('&lt;pip._vendor.urllib3.connection.HTTPConnection object at 0x7f74089dcac0&gt;: Failed to establish a new connection: [Errno 111] Connection refused'))
  
  ERROR: Service 'web' failed to build : The command '/bin/sh -c pip install -r requirements.txt $PIP_EXTRA_INDEX_URL' returned a non-zero code: 1
  </code></pre>
  <p>Is any configuration missing in this code?</p>