Docker Compose Dev, Debugging, CI, and Production Patterns/Run integration stack and exit with service code

Runs an integration stack and returns the test container exit code.

Section: CI/CD and Release Patterns

Run integration stack and exit with service code

bash
bash
docker compose up --abort-on-container-exit --exit-code-from test
Explanation

A common pattern for integration test pipelines.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing CI/CD and Release Patterns
Build stack in CI
Builds the project with CI-specific overrides applied.
OpenIn sheetbashsame section
Tear down CI stack with volumes
Fully cleans up the test environment and removes stale containers.
OpenIn sheetbashsame section
Pull latest images and recreate
Refreshes image-based services to the newest available tags.
OpenIn sheetbashsame section
Run test suite in service
Runs tests in a disposable service container.
OpenIn sheetbash3 tag match
Watch files and sync/rebuild
Watches project files and applies sync or rebuild actions when configured.
OpenIn sheetbash2 tag match
Validate effective config
Checks whether the Compose config is valid without printing it.
OpenIn sheetbash2 tag match