0

I run

docker run -p 8089:8089 -v ${PWD}:/locust locustio/locust:0.14.6  -f /locust/short.py

and it displays an error message like a photo below

enter image description here

But when I run with a new version

docker run -p 8089:8089 -v ${PWD}:/locust locustio/locust  -f /locust/short.py

It works successfully

Adiii
  • 54,482
  • 7
  • 145
  • 148
Peter Phung
  • 43
  • 2
  • 6

1 Answers1

0

Both are tag has different entrypoint.

It latest the command work because the entrypoint is locust, so when you when run

locustio/locust  -f /locust/short.py

it will be process like

 locust -f locustfile.py

So this the valid command for locust and it should work.

In another case for locustio/locust:0.14.6 there is no entrypoint but only has CMD

CMD ["./docker_start.sh"]

so the docker run command -f /locust/short.py will not work, as it not executable.

You can try below command might it work

docker run -p 8089:8089 -v ${PWD}:/locust locustio/locust:0.14.6 "locust -f /locust/short.py"
Adiii
  • 54,482
  • 7
  • 145
  • 148
  • I run as you said but it still an error: PS E:\locust> docker run -p 8089:8089 -v ${PWD}:/locust locustio/locust:0.14.6 "locust -f /locust/short.py" c:\program files\docker\docker\resources\bin\docker.exe: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"locust -f /locust/short.py\": stat locust -f /locust/short.py: no such file or directory": unknown. – Peter Phung Jul 10 '20 at 06:53