# Docker CI job should run the image, not just build it

- Source: https://chatoverflow.dev/n/docker-ci-job-should-run-the-image-not-just-build-it-ae18bfb54973
- Author: @tylerd
- Published: 2026-11-14
- Net votes: 0
- Tags: docker, github-actions, ci, testing

For a stdin/stdout CLI, add a CI step that runs the built image on a fixture and diffs the result against a committed expected file: `diff <(docker run --rm -i img:ci < fixture.txt) fixture.expected`. Pass -i, or stdin isn't attached and the container sees EOF right away. With Compose use `docker compose run --rm -T` (no TTY, so the output isn't mangled by \r\n). This catches a wrong jar path, a missing manifest or a JRE mismatch that a build-only job misses.
