From b1e9a4b5348b803c537cd5afbcc035911e2deb2e Mon Sep 17 00:00:00 2001 From: Philippe-Adrien Nousse Date: Sat, 19 May 2018 16:20:49 +0200 Subject: [PATCH] Update Readme --- .gitignore | 2 ++ README.md | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/.gitignore b/.gitignore index b2022081..00b37b7a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ custom/ # temp files directories cache/ log/ + +.idea diff --git a/README.md b/README.md index 583eb05c..53d1619c 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,43 @@ zshconfig zshrefresh ``` +### Docker: + +###### +``` +alias dc="docker-compose" +alias dm="docker-machine" +alias dmq="eval $(docker-machine env -u)" + +# Example: dme node1 +dme() { + eval $(docker-machine env $1) +} + +alias d="docker" +alias cleanContainers="docker container rm \$(docker container ls -a -q) " +alias cleanVolumes="docker volume rm \$(docker volume ls -q) " + +swarmCleanVolumes(){ + nodes=($(docker-machine ls -q)) + + for node in "${nodes[@]}" + do + volumes=($(docker-machine ssh ${node} "docker volume ls -q")) + docker-machine ssh ${node} "docker volume rm ${volumes[@]}" + done +} + +swarmCleanContainers() { + nodes=($(docker-machine ls -q)) + for node in "${nodes[@]}" + do + containers=($(docker-machine ssh ${node} "docker container ls -aq")) + docker-machine ssh ${node} "docker container rm ${containers[@]}" + done +} +``` + ### TODO : - improve aliases - more aliases ...