Pinned goss + dgoss in a hardened Alpine + Docker-CLI container for reproducible image-smoke-tests in CI. Drop-in for Forgejo / GitHub Actions container jobs that need to assert "the freshly built image actually works."
docker pull tcwlab/dgoss:latest
# Run goss against the current directory's goss.yaml on a target image
docker run --rm \
-v "$PWD/goss/goss.yaml:/tmp/goss.yaml:ro" \
-v /var/run/docker.sock:/var/run/docker.sock \
tcwlab/dgoss:latest \
dgoss run my-target-image:test
Or as a Forgejo / GitHub Actions container job:
smoketest:
runs-on: ubuntu-22.04
container:
image: tcwlab/dgoss:latest
env:
DOCKER_HOST: tcp://docker-in-docker:2375
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- run: dgoss run my-target-image:test
Quick-start examples use
:latest. For production CI pipelines, pin a concrete tag — see Tags below.
Most tcwlab consumers don't invoke tcwlab/dgoss directly — they call the image-smoketest composite action from the tcwlab/actions repo, which wraps this image with a stable input contract (image reference, goss file path, expected version).
- name: Smoke-test built image
uses: https://<your-forgejo-host>/tcwlab/actions/.forgejo/actions/image-smoketest@v1
with:
image: tcwlab/forgejo-build:myservice-${{ github.sha }}
gossfile: goss/goss.yaml
expected-version: "1.11.6"
Version numbers below are illustrative. For the current set of tags, see Docker Hub tags.
| Tag | Description |
|---|---|
0.4.9, 0.4, 0 | Concrete SemVer (recommended for production pipelines) |
latest | Rolling reference; always points at the newest release |
Always pin a concrete version in production. The image tag mirrors
the upstream goss release exactly: tcwlab/dgoss:0.4.9 contains
goss v0.4.9 and the matching dgoss wrapper.
linux/amd64linux/arm64Every tag is a multi-arch manifest list.
| Tool | Version | Purpose |
|---|---|---|
goss | 0.4.9 | Container-content assertion engine |
dgoss | 0.4.9 | Wrapper that runs goss against a Docker container |
docker CLI | 29.x (Alpine apk) | Required by dgoss to talk to the daemon |
bash | from Alpine 3.23 apk | dgoss is a bash script |
curl | from Alpine 3.23 apk | Network ops, debug |
ca-certificates | from Alpine 3.23 apk | TLS/SSL certificate validation |
Base image: docker:29-cli-alpine3.23. Default workdir: /workspace. Default user: gossusr (non-root).
docker run --rm \
-v "$PWD/goss/goss.yaml:/tmp/goss.yaml:ro" \
-e DOCKER_HOST=tcp://docker-in-docker:2375 \
tcwlab/dgoss:0.4.9 \
bash -c 'GOSS_FILE=/tmp/goss.yaml dgoss run my-target-image:test'
goss --version (no Docker daemon needed)docker run --rm tcwlab/dgoss:0.4.9 goss --version
smoketest:
name: Image smoketest
runs-on: ubuntu-22.04
needs: build-test
container:
image: tcwlab/dgoss:0.4.9
env:
DOCKER_HOST: tcp://docker-in-docker:2375
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- name: Pull staging image
run: docker pull "tcwlab/forgejo-build:myservice-${{ github.sha }}"
- name: dgoss validate
env:
GOSS_FILE: goss/goss.yaml
run: dgoss run "tcwlab/forgejo-build:myservice-${{ github.sha }}"
The image passes goss/dgoss environment variables straight through. Common ones:
| Variable | Example | Purpose |
|---|---|---|
GOSS_FILE | goss/goss.yaml | Path to the goss assertion file inside the container |
GOSS_OPTS | --retry-timeout 30s | Extra arguments to goss validate |
GOSS_WAIT_OPTS | --retry-timeout 30s | Extra arguments to the goss wait precondition |
GOSS_SLEEP | 0.5 | Seconds to sleep between retries |
DOCKER_HOST | tcp://docker-in-docker:2375 | Docker daemon endpoint (matches Forgejo runner net) |
| Path | Purpose |
|---|---|
/workspace | Default workdir; mount your goss.yaml into the container or use a bind-mount |
tcwlab/dgoss and not the upstream goss binary?Three reasons:
latest or floating majors, which lets a CI tool silently advance. tcwlab/dgoss pins to an exact upstream version and bumps via PR.tcwlab/* image.image-smoketest composite action so consumer repos write a goss.yaml and one uses: line, not 30 lines of Docker plumbing.github.com/tcwlab/dgossgithub.com/tcwlab/dgoss/issueshub.docker.com/r/tcwlab/dgossEvery release is built and published by the repo's own .forgejo/workflows/ci.yml on a Forgejo runner:
linux/amd64, linux/arm64) via docker buildx with --sbom=true --provenance=mode=max.goss validate against the very goss.yaml shipped in this repo (dogfooding).HIGH/CRITICAL severity (failures show up as PR comments).betterlint running against the Dockerfile.The dgoss image version is cut by semantic-release from Conventional Commits on main. The version exactly mirrors the upstream goss release (e.g., release of goss 0.4.11 triggers a new tcwlab/dgoss:0.4.11 image).
Apache License 2.0. See LICENSE for the full text.
goss itself is licensed under Apache-2.0. See goss-org/goss for details.
Content type
Image
Digest
sha256:290e96ed0…
Size
71.3 MB
Last updated
3 months ago
docker pull tcwlab/dgoss