הפעלת פקודות rails מ-Bash המארח

This is expected; you are telling docker to execute the binary /usr/local/bin/rails console in the container. That is, a single file with an embedded space. This file doesn’t exist.

consider the following:

○ → docker run -i debian /bin/echo hello
hello

○ → docker run -i debian '/bin/echo hello'
docker: Error response from daemon: OCI runtime create failed: container_linux.go:367: starting container process caused: exec: "/bin/echo hello": stat /bin/echo hello: no such file or directory: unknown.
ERRO[0000] error waiting for container: context canceled 

Quote the command the same way as if you were executing from inside the container:

○ → docker exec -i app rails runner 'puts "hello"'
hello

Using the example from the OP, this should work:

docker exec -i app rails runner 'UserDestroyer.new(Discourse.system_user).destroy(User.find_by_username_or_email("user@example.com"), delete_posts: false)'