When executing a Unix job that runs Docker Compose, the Automic Agent reports a successful completion (Return Code 0) even if a specific container within the Docker environment fails with an exit code (e.g., RC 1). This behavior prevents the Automation Engine from detecting internal application failures within the Docker stack.
RET-CODE: 0 in the job report.exited with code 1).ENDED_OK.By default, the command docker compose up returns the exit code of the Docker Compose orchestrator itself, which is typically 0 if the environment was successfully built and started. It does not automatically pass through the exit code of individual service containers to the shell/agent.
To ensure the Automic Agent captures the failure of a specific container, use the --exit-code-from flag in the job script. This flag forces the docker compose command to return the exit code of the specified service container.
docker-compose.yml file that contains the critical process.Example: If the service is named app-backend, the command should be: