Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Week 39: Docker for Java Developers Part 1 #60

Open
shekhargulati opened this issue Oct 7, 2016 · 2 comments
Open

Week 39: Docker for Java Developers Part 1 #60

shekhargulati opened this issue Oct 7, 2016 · 2 comments
Labels

Comments

@shekhargulati
Copy link
Owner

Please provide your feedback by posting a comment against this issue.

@soleo
Copy link

soleo commented Oct 10, 2016

When you are building all kinds of docker images, you may end up with a lot of untagged images, volumes. A trick I used in my own projects is a bash function like this.

# docker clean up, remove all stopped containers and untagged images
# http://jimhoskins.com/2013/07/27/remove-untagged-docker-images.html
# https://github.com/chadoe/docker-cleanup-volumes
# https://www.calazan.com/docker-cleanup-commands/
docker-cleanup() {
    docker rm $(docker ps -a -q);
    docker rmi $(docker images -q -f dangling=true);
    docker volume rm $(docker volume ls -qf dangling=true)
}

Most of the times, just removing the stopped containers is good enough. But it's nice to have something to clean up locally.

@shekhargulati
Copy link
Owner Author

@soleo thanks. I have added it to the blog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants