rse-bash-modules.sh 368 Bytes
Newer Older
Cooper, Caleb's avatar
Cooper, Caleb committed
1
2
3
4
5
6
7
8
9
10
func_rse_docker_cleanup() {
    if [[ ! 'docker' =~ $(groups) ]]; then
        sudo gpasswd -a "${USER}" 'docker'
    fi
    docker stop $(docker ps -aq) || true
    docker rm $(docker ps -a -q) || true
    docker rmi $(docker images -q) || true
    docker image prune -fa || sudo systemctl restart docker
    docker system prune -fa || sudo systemctl restart docker
}