—————–
Jenkins has been installed in instance2 in Unix machine on GCE
SonarQube is running inside a docker container in the same host as Jenkins is running ( i.e instance2) This is how i started this:
sudo docker container run -d --name sonarqube -p 9000:9000 -p 9092:9092 -e SONARQUBE_HOME=/sonarqube-data -v sonarqubevol1:/sonarqube-data sonarqube:8.1-community-beta
Note that, in the above command, i am using docker persistent volumes.
—————–
Remove docker images that are not needed:
docker image prune
If you give the -a option, it will also remove all images not referenced by any container.
docker image prune -a
List the images along with their creation date:
docker images --format 'table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.CreatedAt}}\t{{.Size}}'
Delete any images created before a certain date:
The following removes images created before 2017-01-04T00:00:00
:
docker image prune -a --force --filter "until=2017-01-04T00:00:00"
List of all images that are untagged:
docker images | grep "" | awk "{print \$3}"
Do this to get rid of all untagged images ( try without the -f option).
docker rmi $(docker images | grep "<none>" | awk "{print \$3}")
docker rmi -f $(docker images | grep "<none>" | awk "{print \$3}")