14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/tagfish/cli/tags_command.rb', line 14
def execute
docker_uri = DockerURI.parse(repository)
docker_api = DockerRegistryClient.for(docker_uri, debug?)
if latest?
tags = docker_api.tags
latest_tags = tags.latest_tags
if latest_tags.empty?
signal_error "No image explicitly tagged in this Repository, " +
"only `latest` tag available."
end
tags_found = latest_tags
else
tags_found = docker_api.tag_names
end
tags_fqdn = tags_found.map do |tag_name|
short? ? tag_name : docker_uri.with_tag(tag_name).to_s
end
puts tags_fqdn
end
|