title: Using Docker with Python Poetry?
body: <p>I've been using Docker with pipenv for my data science deployment setup and now I want to change to Poetry. My Dockerfile is:</p>
  <pre><code>FROM python:3.8-alpine3.13
  
  ENV POETRY_VIRTUALENVS_CREATE=false \
      POETRY_VERSION=1.1.11
  
  RUN apk add --no-cache python3-dev gcc libc-dev musl-dev openblas gfortran build-base postgresql-libs postgresql-dev libffi-dev \
    &amp;&amp; pip install poetry
  COPY pyproject.toml poetry.lock ./
  RUN poetry export -f requirements.txt --output requirements.txt &amp;&amp; sed -i 's/^-e //' requirements.txt
  
  USER root
  RUN apt-get update &amp;&amp; apt-get install -y --no-install-recommends python3-dev gcc libc-dev musl-dev openssh-client git libpq-dev \
    &amp;&amp; apt-get clean -y
  
  
  # install dependencies from requirements.txt
  RUN pip install --no-cache-dir --user -r requirements.txt
  
  COPY . .
  CMD [&quot;jupyter&quot;, &quot;notebook&quot;, &quot;--port=8888&quot;, &quot;--no-browser&quot;, &quot;--ip=0.0.0.0&quot;, &quot;--allow-root&quot;]
  </code></pre>
  <p>My <code>pyproject.toml</code>:</p>
  <pre><code>[tool.poetry]
  name = &quot;&quot;
  version = &quot;1.0.0&quot;
  description = &quot;&quot;
  authors = [&quot;&quot;]
  
  [tool.poetry.dependencies]
  python = &quot;^3.8&quot;
  
  ... # lots of libraries, omitted here
  
  [tool.poetry.dev-dependencies]
  black = &quot;*&quot;
  ipykernel = &quot;6.*&quot;
  ipython = &quot;7.*&quot;
  isort = &quot;5.*&quot;
  jupyter = &quot;*&quot;
  pytest = &quot;6.*&quot;
  pre-commit = &quot;2.*&quot;
  
  [build-system]
  requires = [&quot;poetry-core&gt;=1.0.0&quot;]
  build-backend = &quot;poetry.core.masonry.api&quot;
  
  </code></pre>
  <p>This is based on other Dockerfiles that I found on StackOverflow. I run into the following problem:</p>
  <pre><code>Step 7/10 : RUN apt-get update &amp;&amp; apt-get install -y --no-install-recommends python3-dev gcc libc-dev musl-dev openssh-client git libpq-dev   &amp;&amp; apt-get clean -y
   ---&gt; Running in 447ffb83d555
  /bin/sh: apt-get: not found
  The command '/bin/sh -c apt-get update &amp;&amp; apt-get install -y --no-install-recommends python3-dev gcc libc-dev musl-dev openssh-client git libpq-dev   &amp;&amp; apt-get clean -y' returned a non-zero code: 127
  Running containerdocker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: &quot;jupyter&quot;: executable file not found in $PATH: unknown.
  ERRO[0000] error waiting for container: context canceled 
  make: *** [Makefile:6: jupyter_notebook] Error 127
  
  </code></pre>
  <p>So this looks like the Poetry is not used, where Jupyter is installed, and therefore it cannot be found. How can I fix this?</p>