ironic-python-agent/imagebuild/coreos/docker_clean.bash
Jay Faulkner 141938ec3f img(coreos): Initial commit of CoreOS image build
- Mostly imported from github.com/racker/teeth-agent-image
2014-03-04 15:16:35 -08:00

17 lines
402 B
Bash
Executable File

#!/bin/bash
#
# Cleans up docker images and containers
containers=$(docker ps -a -q)
images=$(docker images -q)
# All the docker commands followed by || true because occassionally docker
# will fail to remove an image or container, & I want make to keep going anyway
if [[ ! -z "$containers" ]]; then
docker rm $containers || true
fi
if [[ ! -z "$images" ]]; then
docker rmi $images || true
fi