script_exporter icon indicating copy to clipboard operation
script_exporter copied to clipboard

Error encountered when executing script with Docker - 6: docker: command not found

Open ginsul opened this issue 1 year ago • 1 comments

Hi,

Seems like there are problem when running docker?

ts=2024-02-15T11:18:16.300Z caller=scripts.go:108 level=debug msg="Script 'docker' execution succeed" cmd=./examples/docker.sh stdout="0\nnumber_of_files 0\n" stderr="./examples/docker.sh: line 6: docker: command not found\n" env=

Running with :

docker run --rm -it --name script_exporter -p 9469:9469 -v $(pwd):/examples -v /var/run/docker.sock:/var/run/docker.sock ricoberger/script_exporter:main -config.file /examples/config.yaml -log.level=debug

Thank you

ginsul avatar Feb 15 '24 11:02 ginsul

Hi @ginsul, the /examples/docker.sh example requires Docker and was used to test, if the output of a Docker container can be used with the exporter.

This example will not work with our Docker image, since it doesn't contain Docker.

If you want to use it, you have to build your own Docker image where Docker is installed inside the image, to have a Docker in Docker setup. I'm not completely sure if this will work, since I never tested it.

ricoberger avatar Feb 16 '24 09:02 ricoberger

Hi @ginsul, since there is no activity for some time, I will close the issue for now. If this is still a problem please let me know and we can reopen the issue.

ricoberger avatar Apr 26 '24 20:04 ricoberger