Goss#
Goss is a YAML-based server validation tool used in this course as an optional (+1 pt) complement for automating infrastructure tests against a Docker Compose stack.
Supported Resource Types#
Goss's built-in resource types are host-level constructs. The official list includes :
package,file,addr,port,service,user,groupcommand,dns,process,kernel-param,mount,interfacehttp,goss(for importing other goss files),matching
docker-container is NOT a native Goss resource type. The Goss README explicitly notes that for testing containers, users should use the dgoss wrapper or dcgoss for Docker Compose instead.
docker-container in Course Examples — A Known Pitfall#
The exam specification includes a goss.yaml example that uses a docker-container block to verify container state and health status :
docker-container:
reverse-proxy:
running: true
status: "running"
app-server:
running: true
status: "running"
health-status: "healthy"
database:
running: true
status: "running"
health-status: "healthy"
This block will be silently ignored by Goss when run natively (goss validate), because docker-container is not a recognized resource type. Goss does not error on unknown top-level keys in goss.yaml — it simply skips them without warning. Only the port and http blocks in that same example would actually be evaluated.
To test Docker container state using Goss, the correct approach is to use dgoss or dcgoss, which wrap Goss to run it inside a container and map Docker state to Goss-compatible checks.
Evaluation Criteria in Course Exercises#
Goss is Complément 2 in the M2 ILI DevOps – Docker final project (Partie 1), graded out of 1 point :
| Criterion | Points |
|---|---|
goss.yaml with comprehensive tests | 0.5 pt |
| CI/CD pipeline that runs Goss tests | 0.25 pt |
| Test report generated (JUnit XML or JSON) | 0.25 pt |
The complement is optional; the grade formula caps at 10/10: Note = min(10, critères principaux + compléments) .
Running Goss in CI#
The exam specification provides a GitLab CI example :
test-infrastructure:
stage: test
image: docker:24
services:
- docker:24-dind
script:
- curl -fsSL https://goss.rocks/install | sh
- docker compose up -d
- sleep 30
- goss validate --format junit > goss-report.xml
artifacts:
reports:
junit: goss-report.xml
Reports can be produced in junit (GitLab artifact integration), json, documentation, or other supported output formats.
Key References#
- Goss GitHub repo
- Goss manual — linked in course materials
- dcgoss – Docker Compose wrapper — correct approach for container-level tests
- Exam specification – Complément 2