Goss is a YAML based serverspec alternative tool for validating a server’s configuration. It eases the process of writing tests by allowing the user to generate tests from the current system state. Once the test suite is written they can be executed, waited-on, or served as a health endpoint.
# cd into the directory with your Dockerfile and build your image.
docker build -t MyApp .
# This is an example for a docker image named MyApp:
docker run --rm -it \
-v "$(pwd)":/goss \
-v /tmp:/tmp \
-v /var/run/docker.sock:/var/run/docker.sock \
dsuite/goss dgoss edit MyApp
goss a process MyApp
goss a user root
goss a user user2
goss a file /dir
goss a file /dir/file
goss a http http://localhost:8080
exit
# this will generate a goss.yaml file in your current folder.
See the Goss manual for more details
docker run --rm -it \
-v "$(pwd)":/goss \
-v /tmp:/tmp \
-v /var/run/docker.sock:/var/run/docker.sock \
dsuite/goss dgoss run MyApp
Whant to see goss in action, visit goss-examples