Skip to content

Instantly share code, notes, and snippets.

@andkirby
Created July 24, 2017 13:49
Show Gist options
  • Save andkirby/9c28c2bb9932388e7eaa039cba97af57 to your computer and use it in GitHub Desktop.
Save andkirby/9c28c2bb9932388e7eaa039cba97af57 to your computer and use it in GitHub Desktop.
Uninstall script for opal-satis containers.
#!/usr/bin/env bash
set -o pipefail
set -o errexit
set -o nounset
#set -o xtrace
# Set magic variables for current file & dir
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
readonly __dir __file
docker-compose --file ${__dir}/docker-compose.yml down || true
if docker images --filter=reference='*_satis:latest' --format='{{.Repository}}' | grep satis > /dev/null; then
docker rmi -f $(\
docker images --filter=reference='*_satis:latest' --format='{{.Repository}}') || true
fi
docker rmi -f composer/satis || true
docker rmi -f ilagnev/alpine-nginx-lua || true
if docker volume ls | grep -E '_(api|opal.*)-vol' > /dev/null; then
docker volume rm $(\
docker volume ls | grep -E '_(api|opal.*)-vol' | awk '{print $2}') || true
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment