Sha256: 2565a8b84765b63feb0804890085b181109e9519f336d89e2756b208ce0ff285
Contents?: true
Size: 686 Bytes
Versions: 6
Compression:
Stored size: 686 Bytes
Contents
module AppRb::Util::Registry def self.tags_list(registry, image_name) o = JSON.load(AppRb::Util.just_cmd("curl -s https://#{registry}/v2/#{image_name}/tags/list")) o.is_a?(Hash) && o["errors"] ? [] : o["tags"] end def self.clean(registry, image_name, keep_tags = []) (tags_list(registry, image_name) - keep_tags).each do |hash| digest = AppRb::Util.just_cmd("curl -s --head -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' https://#{registry}/v2/#{image_name}/manifests/#{hash} | grep Docker-Content-Digest | cut -d' ' -f2") AppRb::Util.do_it "curl -s -X DELETE https://#{registry}/v2/#{image_name}/manifests/#{digest}" end end end
Version data entries
6 entries across 6 versions & 1 rubygems