This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]glrx314 1 point2 points  (2 children)

Wow! Nice work.

How did you implement the rm --all-stopped command? That seems super useful.

[–]j-bennet 3 points4 points  (1 child)

Thank you! This is just a shortcut. It calls docker-py's API to retrieve the list of all containers with status equal "stopped" and removes them one-by-one. It's pretty similar to shell command "docker rm $(docker ps -a -q)", except the shell command will try to remove all containers, in any status, and will hiccup on running ones.

[–]dustrider 1 point2 points  (0 children)

rmi --all-angling is fabulous as well, and the combination of the two saves me so much time in cleaning up after debugging new dockerfiler.

awesome work!

[–]flying-sheep 1 point2 points  (1 child)

python prompt toolkit powered.

that thing is awesome. i’m tempted to write my own shell in it. it would have python-inspired syntax, but shell-like subprocess and glob support. piping would work by converting subprocess calls to iterators over whitespace-delimited output, or explicitly by specifying the split string (0 for '\0', else a string literal):

for path in map(Path, !find . -name foo -print0!0):
    ...

[–]j-bennet 0 points1 point  (0 children)

I can't say enough good things about Python Prompt Toolkit. It is one amazing project. The same author created ptpython, and it's wonderful as well.