From 73f2eebea5e0d0782be548735812567265881294 Mon Sep 17 00:00:00 2001 From: Kimberly Garmoe Date: Fri, 2 Feb 2018 05:13:04 -0800 Subject: [PATCH] Refactors docker_image resource (#2518) Signed-off-by: kagarmoe --- docs/resources/docker_image.md.erb | 53 ++++++++++++++++-------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/docs/resources/docker_image.md.erb b/docs/resources/docker_image.md.erb index fcd49bc96..ef8a908b3 100644 --- a/docs/resources/docker_image.md.erb +++ b/docs/resources/docker_image.md.erb @@ -19,6 +19,10 @@ A `docker_image` resource block declares the image: its('tag') { should eq 'latest' } end +
+ +## Resource Parameter Examples + The resource allows you to pass in an image id: describe docker_image(id: alpine_id) do @@ -39,9 +43,31 @@ You can also pass in repository and tag as separate values
-## Examples +## Property Examples -The following examples show how to use this InSpec `docker_image` resource. +### id + +The `id` property returns the full image id: + + its('id') { should eq 'sha256:4a415e3663882fbc554ee830889c68a33b3585503892cc718a4698e91ef2a526' } + +### image + +The `image` property tests the value of the image. It is a combination of `repository/tag`: + + its('image') { should eq 'alpine:latest' } + +### repo + +The `repo` property tests the value of the repository name: + + its('repo') { should eq 'alpine' } + +### tag + +The `tag` property tests the value of image tag: + + its('tag') { should eq 'latest' } ### Test a docker image @@ -65,26 +91,3 @@ The `exist` matcher tests if the image is available on the node: it { should exist } -### id - -The `id` matcher returns the full image id: - - its('id') { should eq 'sha256:4a415e3663882fbc554ee830889c68a33b3585503892cc718a4698e91ef2a526' } - -### image - -The `image` matcher tests the value of the image. It is a combination of `repository/tag`: - - its('image') { should eq 'alpine:latest' } - -### repo - -The `repo` matcher tests the value of the repository name: - - its('repo') { should eq 'alpine' } - -### tag - -The `tag` matcher tests the value of image tag: - - its('tag') { should eq 'latest' }