Comments (8)
Would you be willing to create and test a PR that adds the "-f" flag for the docker rmi
commands used by the run.sh
script?
from docker-cleanup.
docker rmi -f $(docker images -q) did the job in my laptop.
from docker-cleanup.
I see this too. Docker seems to handle the dependent images strangely. I was able to change the command to a docker rmi -f
but you will have to run the command multiple times in order to remove all the unused images.
from docker-cleanup.
@oomathias You may try to remove the images explicitly from their repository names and tags like
docker images | grep -E 'autodeploy' | awk '{ print $1":"$2 }' | xargs --no-run-if-empty docker rmi
from docker-cleanup.
The following modified run.sh script takes care of deleting images with duplicate ids
run.sh.txt
from docker-cleanup.
I have made a patch in #37 that removes the image by it tags if it has one or more. That should fix it without using -f
.
from docker-cleanup.
The way to remove images in docker is currently:
loop
code = 0
for each docker image ls | trim | split NL | shuffle as line
cells = line | split \s+
code |= docker image rm cells[[0, 2] | shuffle | pop]
if not code
break
If your images are dependent on anything other than images or image tags then this will loop infinitely. To stop that you instead must apply every possible permutation and compare the output of each loop. This also wont take into account tags but it does take into account tags.
from docker-cleanup.
Be careful! this will remove all images:
docker rmi -f $(docker images -q) did the job in my laptop.
Source https://docs.docker.com/engine/reference/commandline/images/#options
from docker-cleanup.
Related Issues (20)
- allow non-looped cleanups HOT 4
- Wrong Docker version on host HOT 9
- License HOT 1
- Janitor deletes data only containers and images HOT 5
- Permission denied? HOT 1
- should use `docker volume rm`
- cannot unmarshal object into Go value of type []string HOT 5
- Use labels instead of container names HOT 1
- Why not use docker commands with clean-up jenkins job? **Not a issue - just a thought**
- KEEP_VOLUMES HOT 2
- Limit disk usage with LRU HOT 1
- Does not remove images without -f parameter for docker rmi command HOT 2
- Avoid mounting /var/lib/docker directory from host HOT 1
- Containers getting incorrectly cleaned up? HOT 7
- image cleanup based on created time HOT 1
- Script attempts to remove non-local docker volume (noop, but still) HOT 2
- Tag suggestion for Docker Hub project HOT 1
- Allow wildcards in exclude list HOT 4
- Support for overlay HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-cleanup.