Public Repository

Last pushed: 2 years ago
Short Description
This image inspects the output of 'docker inspect' against a set of expected values.
Full Description

image-inspector inspects a docker image to make sure that it has been built as expected. It does this by analysing what it finds from a docker inspect command and compares this to a configuration file that contains a set of expected values. It will look for both missing and additional items in the new image's inspect output and will output the report to your terminal.

Run command;

docker run --net=host --rm -v <local_dir>:/tmp -v /var/run/docker.sock:/var/run/docker.sock darrenajackson/image-inspector -i <image_to_inspect> -f /tmp/<config_file>

Where <local_dir> is the local directory containing the <config_file>.

Example config file;
{
"RepoTags": [
"darrenajackson/image-inspector:latest"
],
"ContainerConfig": {
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"LANG=C.UTF-8",
"GPG_KEY=C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF",
"PYTHON_VERSION=2.7.11",
"PYTHON_PIP_VERSION=8.1.1"
],
"Cmd": [
"/bin/sh",
"-c",
"#(nop) CMD [\"--help\"]"
],
"Entrypoint": [
"/usr/local/bin/image-inspector.py"
],
},
"DockerVersion": "1.10.3",
"Author": "Darren Jackson, \u003cdarren.a.jackson\u003e",
"Config": {
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"LANG=C.UTF-8",
"GPG_KEY=C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF",
"PYTHON_VERSION=2.7.11",
"PYTHON_PIP_VERSION=8.1.1"
],
"Cmd": [
"--help"
],
"Entrypoint": [
"/usr/local/bin/image-inspector.py"
],
},
"Architecture": "amd64",
"Os": "linux",
}

Additionally you can also run the container in debug mode with a -d flag for a full report of what it finds;

docker run --net=host --rm -v <local_dir>:/tmp -v /var/run/docker.sock:/var/run/docker.sock darrenajackson/image-inspector -i <image_to_inspect> -f /tmp/<config_file> -d

Docker Pull Command
Owner
darrenajackson

Comments (0)