Coder Social home page Coder Social logo

Comments (8)

mikljohansson avatar mikljohansson commented on August 14, 2024 17

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.

alonsoir avatar alonsoir commented on August 14, 2024 14

docker rmi -f $(docker images -q) did the job in my laptop.

from docker-cleanup.

willseward avatar willseward commented on August 14, 2024 12

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.

MaRuifeng avatar MaRuifeng commented on August 14, 2024 7

@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.

garceri avatar garceri commented on August 14, 2024

The following modified run.sh script takes care of deleting images with duplicate ids
run.sh.txt

from docker-cleanup.

sorenroug avatar sorenroug commented on August 14, 2024

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.

joeyhub avatar joeyhub commented on August 14, 2024

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.

abdullahawara avatar abdullahawara commented on August 14, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.