i'm using Docker Desktop for Windows. When I try to remove all of my images by this command:
docker rmi $(docker images -q)
I got this error message in command prompt:
unknown shorthand flag: 'q' in -q)
I'm running Docker on Window 10 Pro
Syntax is unix specific, so you change your command for Windows and you'll need to run the whole command in PowerShell or CMD.
remove containers:
powershell "docker ps -a -q | foreach-object { $i = $PSItem.ToString(); $cmd = 'docker'; & $cmd 'rm' '-f' $i }"
remove images:
powershell "docker images -a -q | foreach-object { $i = $PSItem.ToString(); $cmd = 'docker'; & $cmd 'rmi' '-f' $i }"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With