简体   繁体   中英

How to run K6 through docker with influxdb and Grafana

I am trying to execute my k6 tests with docker-compose and then visualise the results in grafana. I have started my containers and then tried editing the command given in the documentation:

docker-compose run -v     \$PWD/samples:/scripts \k6 run     /scripts/es6sample.js

but I keep receiving errors and I am struggling to understand the pattern needed for the command. I want to run the test.js file in the screenshot below: Repo format

The error I am receiving is:

ERROR: for k6_k6_run  Cannot create container for service k6: invalid volume specification: '/Documents/practice_k6/k6/tests:tests:rw': invalid mount config for type "bind": invalid mount path: 'tests' mount path must be absolute

ERROR: for k6  Cannot create container for service k6: invalid volume specification: '/Documents/practice_k6/k6/tests:tests:rw': invalid mount config for type "bind": invalid mount path: 'tests' mount path must be absolute
ERROR: Encountered errors while bringing up the project.
Eoins-MacBook-Air:k6 eoincorr$ 

For anyone interested I found the issue, it was in the volumes within docker-compose.yml file. The volumes in K6 had been entered incorrectly tests:tests instead of tests:/tests

One Could refer to the document i have created here for using the docker-compose setup.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM