Disable substitution of variables


I am trying to execute few SSH command in RUN where one of the command looks like following:

docker stop $(docker ps -a -q)

CircleCI tries to substitute the string starting with $, but since there is no such variable the command fails.

Is there a way to disable variables substitution? I tried using \ in front of $, but it didn’t help as the resulting command looked following: docker stop $(docker ps -a -q)