The single file examples all refer to a multi-stage build Dockerfile
dockmoor list --any Dockerfile
stdout:
image-name image-name:latest image-name:latest@sha256:2c4269d573d9fc6e9e95d5e8f3de2dd0b07c19912551f25e848415b5dd783acf image-name:1.12 image-name:1.12@sha256:2c4269d573d9fc6e9e95d5e8f3de2dd0b07c19912551f25e848415b5dd783acf image-name@sha256:2c4269d573d9fc6e9e95d5e8f3de2dd0b07c19912551f25e848415b5dd783acf example.com/image-name example.com/image-name:latest example.com/image-name:latest@sha256:2c4269d573d9fc6e9e95d5e8f3de2dd0b07c19912551f25e848415b5dd783acf example.com/image-name:1.12 example.com/image-name:1.12@sha256:2c4269d573d9fc6e9e95d5e8f3de2dd0b07c19912551f25e848415b5dd783acf example.com/image-name@sha256:2c4269d573d9fc6e9e95d5e8f3de2dd0b07c19912551f25e848415b5dd783acf
stderr is empty
exit code: 0
dockmoor list --latest Dockerfile
stdout:
image-name image-name:latest image-name:latest@sha256:2c4269d573d9fc6e9e95d5e8f3de2dd0b07c19912551f25e848415b5dd783acf example.com/image-name example.com/image-name:latest example.com/image-name:latest@sha256:2c4269d573d9fc6e9e95d5e8f3de2dd0b07c19912551f25e848415b5dd783acf
stderr is empty
exit code: 0
dockmoor list --unpinned Dockerfile
stdout:
image-name image-name:latest image-name:1.12 example.com/image-name example.com/image-name:latest example.com/image-name:1.12
stderr is empty
exit code: 0
find some-folder/ -type f -exec dockmoor list --unpinned {} \; | sort | uniq
stdout:
nginx nginx:1.15.3 nginx:latest
stderr is empty
exit code: 0
find some-folder/ -type f -exec dockmoor list --latest {} \; | sort | uniq
stdout:
nginx nginx:latest
stderr is empty
exit code: 0
find some-folder/ -type f -exec dockmoor list --any {} \; | sort | uniq
stdout:
nginx nginx:1.15.3 nginx:1.15.3-alpine@sha256:2c4269d573d9fc6e9e95d5e8f3de2dd0b07c19912551f25e848415b5dd783acf nginx:latest nginx@sha256:db5acc22920799fe387a903437eb89387607e5b3f63cf0f4472ac182d7bad644
stderr is empty
exit code: 0
find some-folder/ -type f -exec dockmoor contains --unpinned {} \; -print
stdout:
stderr is empty
exit code: 0
find some-folder/ -type f -exec dockmoor contains --latest {} \; -print
stdout:
stderr is empty
exit code: 0
find some-folder/ -type f -exec dockmoor contains --any {} \; -print
stdout:
stderr is empty
exit code: 0
The contains
command returns with exit code 0 when an image reference was found that matches. Using the --any
predicate allows to match any file with a supported format that contains at least one image reference.
dockmoor contains --any Dockerfile
stdout is empty
stderr is empty
exit code: 0
dockmoor contains --any some-folder/NotADockerfile
stdout is empty
stderr is empty
exit code: 4
-
Dockerfile (as used by
docker build
)
-l, --log-level Sets the log-level (one of NONE
, ERROR
, WARN
, INFO
, DEBUG
)
--version Show version and exit
--manpage Show man page and exit
--markdown Show usage as markdown and exit
--asciidoc-usage Show usage as asciidoc and exit
-h, --help Show this help message
Specify which kind of image references should be selected. Exactly one must be specified
--any Matches all images
--latest Matches images with latest or no tag
--unpinned Matches unpinned images
-h, --help Show this help message
Specify which kind of image references should be selected. Exactly one must be specified
--any Matches all images
--latest Matches images with latest or no tag
--unpinned Matches unpinned images