Executing K6 on Docker Container
What is k6?
Grafana’s k6 is an open-source load testing tool that makes performance testing easy and productive for engineering teams. k6 is free, developer-centric, and extensible.
Using k6, you can test the reliability and performance of your systems and catch performance regressions and problems earlier. k6 will help you to build resilient and performant applications that scale.
Why run Performance test on container?
- It avoids having to setup a local Go environment.
How to execute k6 on docker container?
- Creating a simple k6 js script
- Create k6 Dockerfile
- Command to build k6 docker image:
docker build . -t dock-k6
- Command to run on k6 script on Docker
docker run --rm dock-k6 run sample.js
Sample project:
https://github.com/shiskr/k6-sample
Free Sample Rest API Source: https://gorest.co.in/