April 7, 2020

Docker :: Tips and tricks

(Last Updated On: 30th June 2018)

This post will be ever evolving as I find more tips and tricks for working with Docker on Windows.  Why not bookmark it and check back?


When spawning interactive linux containers, use bash over sh as it provides a more feature rich shell with tab completion, history and cursor actions.

PowerShell commands

You can tidy up your docker engine by removing all containers with the command.
docker ps -aq | % {docker rm -f $_}
This command is simple for those who are familiar with powershell but essentially you are generating a list of container id’s with docker ps -aq and then piping them to a follow up command.  The % is an alias for for-eachobject, so for-every image id run the command docker rm -f $_.  As we are in a code block, $_ is the image id at each iteration.

Previous «
Next »

Simon is a sysadmin for a global financial organisation and specialises in Windows, security and automation.

Leave a Reply

Subscribe to SYNACK via Email

%d bloggers like this: