locust.io load testing (based on christianbladescb/locustio)
894
Use locust.io in docker, for great portability!
Assuming you have a locustfile.py in the root of your project, make a Dockerfile like this:
FROM ctwise/locust
Then build and run the docker image:
$ docker build -t mylocust .
$ docker run --rm -P mylocust
Any requirements you have listed in your requirements.txt will be installed during the build, and locust runs locustfile.py by default!
Alternatively, if you don't have a requirements.txt file, you can run a temporary, anonymous container by sharing your locustfile.py into it. Assuming you have a locustfile.py file in the current folder you're in, you can run with this command:
docker run --rm -v `pwd`:/locust -p 8089:8089 ctwise/locust --host http://mysite
You will also be able to access the web interface at http://localhost:8089
If you want to run in master/slave mode, specify a different file to run, etc, you can pass the appropriate flags to the container.
$ docker run -d --name master -P mylocust -f otherlocustfile.py --host=http://foo.com --master
$ docker run -d --name slave --link master mylocust -f otherlocustfile.py --host=http://foo.com --slave --master-host=master
Content type
Image
Digest
Size
131.3 MB
Last updated
about 7 years ago
docker pull ctwise/locust