the k6 Docker image runs as an unprivileged
k6 user, and with your addition of
statsd_exporter you might’ve reset some permissions to
root or changed the working directory to one that the
k6 user can’t read. Try fixing it with
chmod or with the
WORKDIR instruction. We might be able to help more if you share your Dockerfile, but in general this is not a Docker support forum.
Though is there a particular reason you have to change the k6 Docker image or create a custom one at all? I think it would be simpler if you started the exporter as a separate container and sent it metrics with
k6 run --out statsd.
FWIW, I don’t get a
permission denied error with the official image:
> sudo docker run --rm -it loadimpact/k6 run path-that-does-not-exist
/\ |‾‾| /‾‾/ /‾/
/\ / \ | |_/ / / /
/ \/ \ | | / ‾‾\
/ \ | |‾\ \ | (_) |
/ __________ \ |__| \__\ \___/ .io
WARN The moduleSpecifier "path-that-does-not-exist" 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 The moduleSpecifier "path-that-does-not-exist" 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://path-that-does-not-exist": dial tcp: lookup path-that-does-not-exist on 172.16.1.1:53: no such host"