Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be able to install pip packages using the docker image #1149

Closed
max-rocket-internet opened this issue Nov 15, 2019 · 1 comment · Fixed by #1150
Closed

Be able to install pip packages using the docker image #1149

max-rocket-internet opened this issue Nov 15, 2019 · 1 comment · Fixed by #1150

Comments

@max-rocket-internet
Copy link
Contributor

The current docker image uses a non-root user: https://github.com/locustio/locust/blob/master/Dockerfile#L18

That's great but it means it's not possible to install pip packages using this docker image:

$ docker run -it locustio/locust:0.13.0 sh -c "pip install --user boto"

WARNING: The directory '/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 153, in _main
    status = self.run(options, args)
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 338, in run
    wheel_cache = WheelCache(options.cache_dir, options.format_control)
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/cache.py", line 219, in __init__
    self._ephem_cache = EphemWheelCache(format_control)
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/cache.py", line 195, in __init__
    self._temp_dir = TempDirectory(kind="ephem-wheel-cache")
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/utils/temp_dir.py", line 57, in __init__
    path = self._create(kind)
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/utils/temp_dir.py", line 90, in _create
    tempfile.mkdtemp(prefix="pip-{}-".format(kind))
  File "/usr/local/lib/python3.6/tempfile.py", line 360, in mkdtemp
    prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir)
  File "/usr/local/lib/python3.6/tempfile.py", line 130, in _sanitize_params
    dir = gettempdir()
  File "/usr/local/lib/python3.6/tempfile.py", line 298, in gettempdir
    tempdir = _get_default_tempdir()
  File "/usr/local/lib/python3.6/tempfile.py", line 233, in _get_default_tempdir
    dirlist)
FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/']
WARNING: The directory '/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
@max-rocket-internet
Copy link
Contributor Author

I will make a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant