Running locust with docker breaks pip install for some packages
See original GitHub issueDescribe 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
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:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 ofpython:3.8-alpine
. We could consider providing two images (locust
andlocust-alpine
) but I’m not sure it’s worth the effort to maintain two images per version.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.