Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker - The moduleSpecifier "..." couldn't be found on local disk

I cannot mount a local folder to a docker volume on docker-compose so it is not accessible on docker-compose run cmd.

Here is a repo from the github https://github.com/up1/demo-k6-docker

When I follow readme on docker-compose run k6 run scripts/sample.js it gives me the following error all the time:

WARN[0000] The moduleSpecifier "scripts/sample.js" has no scheme but we will try to resolve it as remote module. This will be deprecated in the future and all remote modules will need to explicitly use "https" as scheme. ERRO[0000] The moduleSpecifier "scripts/sample.js" couldn't be found on local disk. Make sure that you've specified the right path to the file. If you're running k6 using the Docker image make sure you have mounted the local directory (-v /local/path/:/inside/docker/path) containing your script and modules so that they're accessible by k6 from inside of the container, see https://k6.io/docs/using-k6/modules#using-local-modules-with-docker. Additionally it was tried to be loaded as remote module by prepending "https://" to it, which also didn't work. Remote resolution error: "Get "https://scripts/sample.js": dial tcp: lookup scripts on 127.0.0.11:53: no such host"

Tried:

  • specifically sharing folder in docker app settings window,
  • different github repos,
  • different mac laptops,
  • different setups Dockerfile copy and -v option on docker run
  • looking for similar questions and docs https://k6.io/docs/using-k6/modules#using-local-modules-with-docker

I would really appreciate some help, banging my head against the wall for a couple of days with this

like image 975
Evgeny Z Avatar asked May 02 '26 09:05

Evgeny Z


1 Answers

Try this.

docker-compose run k6 run //scripts//sample.js

I'm running on docker desktop version 3.1.0 Windows 10 pro.

Solution

like image 98
Ekkapong Naksuwan Avatar answered May 04 '26 19:05

Ekkapong Naksuwan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!