-
-
Save groundnuty/d7ce6fd2fa5ad92adee1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# | |
# | |
# Installing doker on ubuntu. | |
# edit sudo vim /etc/systemd/system/multi-user.target.wants/docker.service | |
# and change -d with daemon | |
# then sudo service docker restart && sudo service docker status | |
# | |
# | |
set -eo pipefail | |
# --filter status=exited | |
for container in $(docker ps --no-trunc --all --quiet); do | |
docker stop $container ; | |
docker rm $container | |
done | |
# -f "dangling=true" | |
for image in $(docker images -q); do | |
docker rmi -f $image | |
done | |
for vol in $(docker volume ls --filter dangling=true | grep '^local' | awk '{print $2}'); do | |
docker volume rm $vol | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment