Skip to content

Commit

Permalink
add sample docker structure tests
Browse files Browse the repository at this point in the history
  • Loading branch information
digorgonzola committed Dec 19, 2023
1 parent 09046de commit dfad7a7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/README-tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Docker Image Structural Testing
The configuration file `test/config.yaml` defines various "structural" checks to perform on the docker image created by `../Dockerfile`.

The test require the use of the [container-structure-test](https://github.com/GoogleContainerTools/container-structure-test) from Google.

Follow their documentation to install.

## Usage
Generate your docker image using your preferred method e.g.
```shell
docker build -t myimage .
```

To run the tests against the image, run the following:
```shell
container-structure-test test --image myimage --config tests/config.yaml
```
10 changes: 10 additions & 0 deletions tests/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
schemaVersion: 2.0.0

commandTests:
- name: "say hello world"
command: "bash"
args:
- -c
- |
echo hello &&
echo world

0 comments on commit dfad7a7

Please sign in to comment.