locust docker code example

Example 1: locust docker

docker run -p 8089:8089 -v $PWD:/mnt/locust locustio/locust -f /mnt/locust/locustfile.py

Example 2: use locust with docker

# Docker-compose helps you to document the process: 
version: "3"
services: 
  master: 
    image: locustio/locust
    ports:
      - "8089:8089"
    volumes:
      - $PWD:/mnt/locust
    command: > 
      -f /mnt/locust/locustfile.py # The image has as entrypoint "locust",
      # so you only need to add the locust flag -f to point at a file.

volumes:
  locust_test:

# Then, docker-compose up and click the given link for the GUI.

Tags:

Misc Example