Container Structure Test
The Container Structure Tests provide a powerful framework to validate the structure of a container image
| 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
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
The schema version of Structure Tests.
A list of command tests
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.
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
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.
9 nested properties
A list of environment variable key/value pairs that should be set in the container.
A list of image labels key/value pairs that should be set on the container.
The entrypoint of the container
The CMD specified in the container
The ports exposed in the container.
The ports NOT exposed in the container.
The volumes exposed in the container.
The volumes NOT exposed in the container
The default working directory of the container.
A list of environment variables can optionally be specified as part of the test setup.
Definitions
The name of the environment variables
The value of the environment variable
The name of the label
The value of the label
Interpreted the value as regex