2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/plankton/commands/tag.rb', line 2
def self.included(base)
base.class_eval do
desc 'tag REPO TAG', 'All the details of of a given tag'
def tag(repo, tag)
tag = registry.tag(repo: repo, tag: tag)
puts "Tag: #{tag.tag}"
puts "Digest: #{tag.digest}"
puts "Created at: #{tag.created_at}"
puts "Layers: #{tag.manifest.layers.size}"
tag.manifest.layers.each do |layer|
puts " #{layer.digest} (#{pretty_size(layer.size)})"
end
puts "Total layer size: #{pretty_size(tag.layer_size)}"
puts "Image:"
puts " Author: #{tag.config.author}"
puts " Operating system: #{tag.config.os}"
puts " Architecture: #{tag.config.architecture}"
puts " Docker version: #{tag.config.docker_version}"
puts "Dockerfile:"
puts " Steps: #{tag.config.history.size}"
rescue RestClient::NotFound => e
puts "Tag #{tag} was not found. (#{e.message})"
exit 1
end
end
end
|