Last active
January 28, 2019 20:04
-
-
Save mihow/1788e8c64f3c8f24abee853533cb5e68 to your computer and use it in GitHub Desktop.
Remove named docker volume in docker-compose project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
set -e | |
DOCKER_COMPOSE_SERVICE_NAME=db | |
CONTAINER_ID=`docker-compose ps -q $DOCKER_COMPOSE_SERVICE_NAME` | |
FULL_VOLUME_NAME=`docker inspect --format='{{range .Mounts}}{{.Name}} {{end}}' $CONTAINER_ID` | |
docker volume rm $FULL_VOLUME_NAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment