title: Docker poetry installl returned a non-zero code (ChunkedEncodingError)
body: <p>I get an issue where when docker-compose up the dependency often fails to install and an error message appears like this:</p>
  <p><a href="https://i.stack.imgur.com/w3ZZW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w3ZZW.png" alt="enter image description here" /></a></p>
  <p>This happens often, but sometimes it works.</p>
  <p><strong>These are the tool that I used:</strong></p>
  <ol>
  <li>docker version 20.10.5</li>
  <li>docker-compose version 1.28.6</li>
  </ol>
  <p><strong>Dockerfile :</strong></p>
  <pre><code>    FROM python:3.8-slim as python-base
  
  # Setup ENV pyhton
  ENV PYTHONFAULTHANDLER=1 \
      PYTHONUNBUFFERED=1 \
      PYTHONHASHSEED=random \
      PIP_NO_CACHE_DIR=off \
      PIP_DISABLE_PIP_VERSION_CHECK=on \
      PIP_DEFAULT_TIMEOUT=100 \
      POETRY_VERSION=1.1.4
  
  # RUN apt-get update &amp;&amp; apt-get install gcc musl-dev libffi-dev openssl make postgresql -y
  RUN apt-get update \
      &amp;&amp; apt-get install --no-install-recommends -y \
      curl \
      openssh-client \
      build-essential \
      openssh-client \
      libpq-dev python3-dev \
      python3-pip python3-setuptools python3-wheel \
      python3-cffi libcairo2 libpango-1.0-0 \
      libpangocairo-1.0-0 libgdk-pixbuf2.0-0 \
      libffi-dev shared-mime-info
  
  # Copy all file
  COPY . /src/debug-internal-tools
  
  # Set working directory
  WORKDIR /src/debug-internal-tools
  ENV PYTHONPATH=${PYTHONPATH}:${PWD}
  
  # Install dependencies
  RUN pip install &quot;poetry==$POETRY_VERSION&quot;
  RUN poetry config virtualenvs.create false &amp;&amp; poetry install
  </code></pre>