397 liens privés
Delete all containers
alias adocker_reset_containers='docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)'
Delete all images
alias adocker_reset_images='docker rmi $(docker images -q)'
Delete all containers and images (reset)
alias adocker_reset_all='docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q) && docker rmi $(docker images -q)'
Get all ip addresses (for all containers)
adocker_ips() {
docker ps -a|grep -v NAMES|rev|sed -r 's/\s+/ /g'|cut -d' ' -f2|rev|xargs -I % sh -c 'echo -n "% -> " && docker inspect --format "{{ .NetworkSettings.IPAddress }}" %'
}
Get all ip addresses (for running containers only)
adocker_ips_only_running() {
docker ps -a|grep -v NAMES|rev|sed -r 's/\s+/ /g'|cut -d' ' -f2|rev|xargs -I % sh -c 'echo -n "% -> " && docker inspect --format "{{ .NetworkSettings.IPAddress }}" %'
}
Get a shell inside a running container
adocker_shell_plz() {
docker exec -it $1 bash
}