ironic-python-agent/imagebuild/coreos/docker_clean.bash
Swapnil Kulkarni (coolsvap) da900108d3 Update typos
Change-Id: Ia0992ebc7a9355d5ea99d0cde28e03fc0d2a1346
2016-01-13 11:14:42 +05:30

17 lines
401 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 occasionally 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