Skip to content

OT-BUILDPIPER-MARKETPLACE/BP-IMAGE-CLEANUP-STEP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BP-IMAGE-CLEANUP-STEP

I'll cleanup all the prior tags of the recently created image

Setup

git submodule init
git submodule update
docker build -t ot/image_cleanup:0.1 .
  • Do local testing
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -e IMAGE_NAME="nginx" -e IMAGE_TAG=stable-alpine ot/image_cleanup:0.1

Reference

docker image prune --filter "until=24h"
docker image prune --filter="label=deprecated"
docker images nginx --filter "before=nginx:stable-alpine"
docker images nginx --filter "before=nginx:stable-alpine" --format "{{.Tag}}"