I've got a repo with some NPM convenience scripts to run some basic docker commands:
"scripts": {
"build": "docker build -t myreadyapi --build-arg LICENSE_SERVER=1.1.1.1 .",
"prestart": "npm run build",
"start": "docker run -p 8089:8088 myreadyapi",
"debug": "docker exec -it $(docker ps -a -q --filter ancestor=myreadyapi) /bin/bash",
"stop": "docker rm $(docker stop $(docker ps -a -q --filter ancestor=myreadyapi))"
}
npm run build
and npm run start
work, but npm run debug
and npm run stop
cause an error:
Error: No such container: $(docker
Note: running this from Windows 10 PowerShell console.
The error happens for any docker script that has a command parameter (i.e. docker ... $(docker ...)
).
Has anyone encountered this before and knows how to fix this?
Cheers.