Skip to content

Commit

Permalink
change to markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdalert committed Apr 11, 2016
1 parent 4a60f7c commit 9e71c96
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docker_cli_one_liners.sh → docker_cli_one_liners.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```
# start shells in the following OS's (rm means it will delete when you exit the shell, see the mittens example for persistance):
docker run -it --rm ubuntu
docker run -it --rm debian
Expand Down Expand Up @@ -93,6 +94,9 @@ docker rm -f $(docker ps -ql)
# Remove all containers forcefully if they are running -f is nice (fastest)
docker rm -f `docker ps -qa`
# another way to stop and delete the last container created (-f above is still fastest/simplest)
docker ps -l -q | awk '{ print $1 }' | xargs docker stop | awk '{ print $1 }' | xargs docker rm
# remove all containers
docker rm $(docker ps -a -q)
#... or ...
Expand All @@ -107,9 +111,6 @@ docker network inspect $(docker network ls -q)
# Delete all networks
docker network rm $(docker network ls -q)'
# another way to stop and delete the last container created (-f above is still fastest/simplest)
docker ps -l -q | awk '{ print $1 }' | xargs docker stop | awk '{ print $1 }' | xargs docker rm
# When you 'docker run' an image and it fails at runtime, it will appear as Exited for example:"Exited (0) 8 days ago"
# exiited containers are refered to as "dangling" images.
# delete all exited/dangling images
Expand Down Expand Up @@ -185,3 +186,4 @@ docker rm $(docker stop $(docker ps -aq))
# Kill and delete all containers
docker rm $(docker kill $(docker ps -aq))
```

0 comments on commit 9e71c96

Please sign in to comment.