Method: Inspec::Resources::Docker#info
- Defined in:
- lib/resources/docker.rb
#info ⇒ Object
118 119 120 121 122 123 124 125 126 127 |
# File 'lib/resources/docker.rb', line 118 def info return @info if defined?(@info) data = {} # docke info format is only supported for Docker 17.03+ cmd = inspec.command('docker info --format \'{{ json . }}\'') data = JSON.parse(cmd.stdout) if cmd.exit_status == 0 @info = Hashie::Mash.new(data) rescue JSON::ParserError => _e return Hashie::Mash.new({}) end |