dockerbuild.rb
def verify_remote_image_tag(registry, image, tag)
        uri = URI("http://#{registry}/v2/#{image}/tags/list")
        begin
            res = Net::HTTP.get_response(uri)
            if res.code == "200"
                json = JSON.parse(res.body)
                if json.has_key?("tags")
                    if json["tags"].include?(tag)
                        status = true
                        message = "remote image and tag exist"
                    else
                        status = false
                        message = "remote image exists but new tag missing"
                    end
                else
                    status = false
                    message = "remote image does not list any tags"
                end
            else
                status = false
                message = "remote image does not exist"
            end
        rescue SocketError
            status = false
            message = "error connecting to #{registry}"
        end
        
        return status, message
    end
# verify image + tag exist in remote repository
# doesn't work with docker hub yet, just the registry
# image
verify image + tag exist in remote repository
doesn't work with docker hub yet, just the registry
image
verify image + tag exist in remote repository doesn ' t work with docker hub yet just the registry image
def verify_remote_image_tag(registry, image, tag)
        uri = URI("http://#{registry}/v2/#{image}/tags/list")
        begin
            res = Net::HTTP.get_response(uri)
            if res.code == "200"
                json = JSON.parse(res.body)
                if json.has_key?("tags")
                    if json["tags"].include?(tag)
                        status = true
                        message = "remote image and tag exist"
                    else
                        status = false
                        message = "remote image exists but new tag missing"
                    end
                else
                    status = false
                    message = "remote image does not list any tags"
                end
            else
                status = false
                message = "remote image does not exist"
            end
        rescue SocketError
            status = false
            message = "error connecting to #{registry}"
        end
        return status, message
    end
def verify_remote_image_tag ( registry , image , tag ) uri = URI ( "http://#{registry}/v2/#{image}/tags/list" ) begin res = Net :: HTTP . get_response ( uri ) if res . code == "200" json = JSON . parse ( res . body ) if json . has_key? ( "tags" ) if json [ "tags" ] . include? ( tag ) status = true message = "remote image and tag exist" else status = false message = "remote image exists but new tag missing" end else status = false message = "remote image does not list any tags" end else status = false message = "remote image does not exist" end rescue SocketError status = false message = "error connecting to #{registry}" end return status , message end
verify image + tag exist in remote repository
doesn't work with docker hub yet, just the registry
image
verify image + tag exist in remote repository doesn ' t work with docker hub yet just the registry image
registry
image
tag