Skip to content

Instantly share code, notes, and snippets.

@cjolowicz
Last active February 12, 2020 08:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjolowicz/078edda96f44ab593cc6442ac9ebaa8d to your computer and use it in GitHub Desktop.
Save cjolowicz/078edda96f44ab593cc6442ac9ebaa8d to your computer and use it in GitHub Desktop.

Run like this:

sh test.sh

Output:

[...]
Using virtualenv: /venv

[TypeError]
expected string or bytes-like object

Traceback (most recent call last):
  File "/root/.poetry/lib/poetry/_vendor/py3.8/clikit/console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "/root/.poetry/lib/poetry/_vendor/py3.8/clikit/api/command/command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "/root/.poetry/lib/poetry/_vendor/py3.8/clikit/api/command/command.py", line 171, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "/root/.poetry/lib/poetry/_vendor/py3.8/cleo/commands/command.py", line 92, in wrap_handle
    return self.handle()
  File "/root/.poetry/lib/poetry/console/commands/install.py", line 47, in handle
    installer = Installer(
  File "/root/.poetry/lib/poetry/installation/installer.py", line 55, in __init__
    installed = self._get_installed()
  File "/root/.poetry/lib/poetry/installation/installer.py", line 488, in _get_installed
    return InstalledRepository.load(self._env)
  File "/root/.poetry/lib/poetry/repositories/installed_repository.py", line 26, in load
    package = Package(name, version, version)
  File "/root/.poetry/lib/poetry/packages/package.py", line 42, in __init__
    self._name = canonicalize_name(name)
  File "/root/.poetry/lib/poetry/utils/helpers.py", line 26, in canonicalize_name
    return _canonicalize_regex.sub("-", name).lower()
FROM python:3.8.1
RUN pip install virtualenv==20.0.2
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
ENV PATH "/root/.poetry/bin:$PATH"
RUN virtualenv /venv
ENV VIRTUAL_ENV /venv
ENV PATH "/venv/bin:$PATH"
RUN poetry new foobar
WORKDIR foobar
CMD ["poetry", "install", "-vvv"]
#!/bin/sh
docker build -t test .
docker run --rm -ti test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment