pip uses thread to show progress bar. Try to disable it:
RUN pip install --progress-bar off -r requirements.txt