Skip to content

Instantly share code, notes, and snippets.

@rafesc
rafesc / remove-docker-containers.md
Created April 18, 2018 21:37 — forked from ngpestelos/remove-docker-containers.md
How to remove unused Docker containers and images
  1. Delete all containers

     $ docker ps -q -a | xargs docker rm
    

-q prints only the container IDs -a prints all containers

Notice that it uses xargs to issue a remove container command for each container ID

  1. Delete all untagged images
@rafesc
rafesc / fedora-install-nodejs.sh
Last active September 8, 2016 00:28 — forked from trajakovic/fedora-install-nodejs.sh
Install node.js on fedora (23+).(v6.5.0)
#!/usr/bin/env bash
func_check_for_root() {
if [ ! $( id -u ) -eq 0 ]; then
echo "ERROR: $0 Must be run as root, Script terminating" ;exit 7
fi
}
func_check_for_root
#SETUP PARAMS