Type object
File match container-structure-test.yaml structure-test.yaml
Schema URL https://catalog.lintel.tools/schemas/schemastore/container-structure-test/latest.json
Source https://www.schemastore.org/container-structure-test.json

Validate with Lintel

npx @lintel/lintel check
Type: object

The Container Structure Tests provide a powerful framework to validate the structure of a container image. These tests can be used to check the output of commands in an image, as well as verify metadata and contents of the filesystem

Properties

schemaVersion string required

The schema version of Structure Tests.

Default: "2.0.0"
commandTests object[]

A list of command tests

fileExistenceTests object[]

File existence tests check to make sure a specific file (or directory) exist within the file system of the image. No contents of the files or directories are checked. These tests can also be used to ensure a file or directory is not present in the file system.

fileContentTests object[]

File content tests open a file on the file system and check its contents. These tests assume the specified file is a file, and that it exists

licenseTests object[]

License tests check a list of copyright files and makes sure all licenses are allowed at Google. By default it will look at where Debian lists all copyright files, but can also look at an arbitrary list of files.

metadataTest object
9 nested properties
env envVar[]

A list of environment variable key/value pairs that should be set in the container.

minItems=1
labels label[]

A list of image labels key/value pairs that should be set on the container.

minItems=1
entrypoint string[]

The entrypoint of the container

minItems=1
cmd string[]

The CMD specified in the container

minItems=1
exposedPorts string[]

The ports exposed in the container.

minItems=1
unexposedPorts string[]

The ports NOT exposed in the container.

minItems=1
volumes string[]

The volumes exposed in the container.

minItems=1
unmountedVolumes string[]

The volumes NOT exposed in the container

minItems=1
workdir string

The default working directory of the container.

globalEnvVars envVar[]

A list of environment variables can optionally be specified as part of the test setup.

minItems=1

Definitions

envVar object
key string required

The name of the environment variables

value string required

The value of the environment variable

label object
key string required

The name of the label

value string required

The value of the label

isRegex boolean

Interpreted the value as regex