docker-k6-grafana-influxdb icon indicating copy to clipboard operation
docker-k6-grafana-influxdb copied to clipboard

Error running the docker-compose run k6 run /scripts/ewoks.js

Open FJLopezGarcia opened this issue 2 years ago • 2 comments

Hi @luketn how are your? I am writing you since i am having an error running the docker-compose run k6 run /scripts/ewoks.js

I have clone the repository and from docker-k6-grafana-influxdb folder after running the docker-compose up -d influxdb grafana (the container is running) image1

But when i run the docker-compose run k6 run /scripts/ewoks.js I am getting the following error: image2

Do you know what could be the root cause? i am running from mac

Thanks a lot isn advance!

FJLopezGarcia avatar Feb 08 '22 17:02 FJLopezGarcia

@FJLopezGarcia you can try to change k6 version to loadimpact/k6:0.34.1

tirmizee avatar Dec 18 '23 07:12 tirmizee

For me as a windows user it worked when I edited the files as follows:

docker-compose.yml

  k6:
    image: loadimpact/k6:latest
    entrypoint: /bin/sh
    user: root
    networks:
      - k6
    ports:
      - "6565:6565"
    environment:
      - K6_OUT=influxdb=http://influxdb:8086/k6
    volumes:
      - ./scripts:/scripts

run-load-test.sh

docker compose up --build -d influxdb grafana
echo "--------------------------------------------------------------------------------------"
echo "Load testing with Grafana dashboard http://localhost:3000/d/k6/k6-load-testing-results"
echo "--------------------------------------------------------------------------------------"
docker compose run --rm -it k6

Then I run this bash command from root directory:

./run-load-test.sh

Inside docker container terminal I run following command:

k6 run /scripts/ewoks.js

Problem was in resolving path to ewoks.js script. When I ran command docker compose run --rm k6 run /scripts/ewoks.js, the path to script was resolved in my Windows context and not in k6 container context. So docker container tried to run script located in C:/Program Files/Git/scripts/ewoks.js.

topolanekmartin avatar Apr 23 '24 08:04 topolanekmartin