Answers for "clean up docker images"

3

docker remove all images

docker rmi $(docker images -a -q)
Posted by: Guest on November-13-2020
0

docker delete images without tag

docker rmi $(docker images -a|grep "<none>"|awk '$1=="<none>" {print $3}')
Posted by: Guest on November-08-2020
0

clean up untagged docker images

# Remove all containers that aren't running.
docker rm -vf $(docker ps -a -q --filter "status=exited")

# Remove untagged images.
docker rmi -f $(docker images -q -f "dangling=true")

# Remove unused volumes using "rm" or "prune".
docker volume rm -f $(docker volume ls -f "dangling=true")
docker volume prune -f

# Remove unused networks.
docker network prune -f
Posted by: Guest on October-20-2021
0

clean up untagged docker images

# Display running containers.
docker ps

# Display all containers using "-a" or "--all".
docker ps -a
docker ps --all

# Filter output using "-f" or "--filter".
docker ps -f "status=exited"
docker ps --filter "status=exited"

# Show only the container ID using "-q" or "--quiet".
docker ps -q -f "status=exited"
docker ps --quiet --filter "status=exited"
Posted by: Guest on October-20-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language