Method: Inspec::Resources::Docker#info
- Defined in:
- lib/resources/docker.rb
#info ⇒ Object
142 143 144 145 146 147 148 149 150 151 |
# File 'lib/resources/docker.rb', line 142 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 |