简体   繁体   English

如何用influxdb和Grafana跑K6到docker

[英]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.我正在尝试使用 docker-compose 执行我的 k6 测试,然后在 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我想运行下面截图中的test.js文件: 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.对于任何感兴趣的人,我发现了这个问题,它在 docker-compose.yml 文件中的卷中。 The volumes in K6 had been entered incorrectly tests:tests instead of tests:/tests K6 中的卷输入错误tests:tests而不是tests:/tests

One Could refer to the document i have created here for using the docker-compose setup.可以参考我在此处创建的使用 docker-compose 设置的文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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