question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running locust with docker breaks pip install for some packages

See original GitHub issue

Describe the bug

When running locust in docker, it breaks the installation of some packages. For now, I’ve noticed the issue comes up with pandas, numpy and scipy. I believe this issue is more suited to locust because when I build the locust docker manually, all the packages install successfully.

Expected behavior

pip install should run without any error.

Actual behavior

image image

image

Steps to reproduce

Very simple dockerfile

FROM locustio/locust

COPY requirements.txt /tmp/custom-requirements.txt

RUN pip3 install --upgrade -r /tmp/custom-requirements.txt

COPY locust-scripts /locust-scripts

Content of requirements.txt

boto3~=1.12.39
sagemaker~=1.55.3
pandas
jinja2~=2.11.2
connexion>=1.1.4
swagger-ui-bundle
flask>=1.0.2
requests

Environment

  • OS: Mac OS
  • Python version: 3.8
  • Locust version: 1.0.2
  • Locust command line that you ran:
  • Locust file contents (anonymized if necessary):

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
heymancommented, Jun 17, 2020

The Locust docker image is also based on the alpine python image (also to minimize the image size). This will likely cause most wheel/binary PyPI packages to fail to install.

You could probably get most packages to install by running apk install ... for all the dependencies, but that can be a hassle.

I think we should consider basing the locust docker image on top of the python:3.8 image instead of python:3.8-alpine. We could consider providing two images (locust and locust-alpine) but I’m not sure it’s worth the effort to maintain two images per version.

0reactions
heymancommented, Jun 17, 2020

This issue should now be fixed in the latest master Docker image. You can try basing your image on locustio/locust:master which is currently being built at Docker Hub and should be done within 30 minutes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running in Docker — Locust 2.5.0 documentation
Use it like this (assuming that the locustfile.py exists in the current working directory): ... FROM locustio/locust RUN pip3 install some-python-package ...
Read more >
Can't install pip packages inside a docker container with Ubuntu
Your problem comes from the fact that Docker is not using the proper DNS server. You can fix it in three different ways...
Read more >
Using Docker and Locust to Load Test Sitecore
Locust is a lightweight, Python-based tool for putting load on your application. A few things that immediately drew me to it: Locust is...
Read more >
ezsmdeploy - PyPI
Cleanest way to install this package is within a virtualenv: python -m venv env source env/bin/activate pip install ezsmdeploy[locust]. In some cases ...
Read more >
Load Testing Using Locust.io - Medium
Install Locust using pip. pip install locust. (or pip3 install locust ). We can validate that we've installed Locust properly by running ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found