Невозможно собрать из Dockerfile для приложения flask python? - PullRequest
0 голосов
/ 07 апреля 2020

У нас есть проект Python, который сочетается с flask latest и python 3.8.1. Мы не можем запустить это приложение с помощью Dockerfile. используя Pipfile для установки пакетов.

Структура проекта:

  • pycache
  • app /
  • .flaskenv
  • config.py
  • Dockerfile
  • pidb.py
  • Pipfile

Dockerfile:

## How to Build
# docker build -f Dockerfile -t abc:v1 .

FROM python:3.8.1

WORKDIR /app
COPY Pip* /app/

RUN apt-get update -y && \
    apt-get install -y python3-pip

RUN pip install pipenv
RUN pipenv install --deploy

ADD . /app/

RUN pipenv shell

EXPOSE 5000

CMD ["flask","run"]

Ошибка:

Step 8/13 : RUN pipenv shell
 ---> Running in e3f2bff609a6
Launching subshell in virtual environment…
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pipenv/cli/command.py", line 385, in shell
    do_shell(
  File "/usr/local/lib/python3.8/site-packages/pipenv/core.py", line 2184, in do_shell
    shell.fork_compat(*fork_args)
  File "/usr/local/lib/python3.8/site-packages/pipenv/shells.py", line 121, in fork_compat
    c.interact(escape_character=None)
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/pexpect/pty_spawn.py", line 761, in interact
    mode = tty.tcgetattr(self.STDIN_FILENO)
termios.error: (25, 'Inappropriate ioctl for device')
The command '/bin/sh -c pipenv shell' returned a non-zero code: 1
...