sergeiwaigant
6/7/2019 - 6:53 AM

Docker references

# Remove all untagged images
docker rmi $(docker images | grep "^<none>" | awk '{print $3}')

# 
docker container prune

# clean up all "Exited" containers
docker rm $(docker ps -a | grep Exited | awk '{ print $1 }')

https://docs.docker.com/install/linux/docker-ce/centos/#set-up-the-repository

sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce
sudo systemctl enable docker
sudo systemctl start docker
sudo usermod -aG docker $USER

Buildah list images with JQ

buildah images --json | jq -r '.[]
buildah images --json | jq -r '.[] | select( .names == null

Cleanup old images without a tag

buildah rmi $(buildah images --json | jq -r '.[] | select( .names == null) | .id')