commit initial

master
jeffrey 2020-04-12 14:49:15 +02:00
parent 35873ce35c
commit 7922a9def0
8 changed files with 34 additions and 1 deletions

View File

@ -1 +1 @@
# docker-bins
Quelques scripts pour faciliter l'utilisation de Docker.

5
docker_clean_all Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
docker_stop_all
docker_delete_all
docker_rmi_all

4
docker_delete_all Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
docker_stop_all
docker rm $(docker ps -a -q)

3
docker_rm_untagged_imgs Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
docker rmi $(docker images | grep "^<none>" | awk "{print $3}")

6
docker_rmi_all Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
for i in `docker images | awk '{print $1}' | grep -v "^REPOSITORY$"`;do
docker untag $i
docker rmi $i
done

7
docker_shell Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
if [ $# -eq 1 ];then
docker exec -i -t $1 /bin/bash || docker exec -i -t $1 /bin/sh
else
docker exec -i -t `docker ps -lq` /bin/bash || docker exec -i -t `docker ps -lq` /bin/bash
fi

4
docker_stop Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
echo "Stopping container '$1'"
docker exec -i -t "$1" killme

4
docker_stop_all Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
echo "Arrêt de tous les containeurs."
docker stop -t 1 $(docker ps -q) 2>/dev/null