build(docker): add script to clean up docker environment (#2013)

Co-authored-by: Mars Lan <mars@trayminder.com>
This commit is contained in:
Mars Lan 2020-12-17 13:52:31 -08:00 committed by GitHub
parent ff7c7fc8e2
commit 36b79a3ef3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

8
docker/nuke.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd $DIR
# Tear down and clean up all DataHub-related containers, volumes, and network
docker-compose -p datahub down -v
docker-compose rm -f -v

View File

@ -188,15 +188,7 @@ docker exec -i mysql sh -c 'exec mysql datahub -udatahub -pdatahub' < docker/mys
```
## I've messed up my docker setup. How do I start from scratch?
1. Delete *all* docker containers, including ones that are created outside of the quickstart guide.
Run the following script to remove all the containers and volumes created during the quickstart tutorial. Note that you'll also lose all the data as a result.
```
docker rm -f $(docker ps -aq)
```
2. Drop all DataHub's docker volumes.
```
docker volume rm -f $(docker volume ls -f name=datahub_ -q)
```
3. Delete DataHub's network
```
docker network rm datahub_network
./docker/nuke.sh
```