Method: Inspec::Resources::Docker#info
- Defined in:
- lib/inspec/resources/docker.rb
#info ⇒ Object
159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/inspec/resources/docker.rb', line 159 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 Hashie::Mash.new({}) end |