47 / 55 · 19 Linux & Command Line · Docker Basics for QA← prev⊞ allnext →☰ Read as one page
6.7Docker in CI/CD
Most CI platforms support Docker natively. GitHub Actions uses the services keyword to run Docker containers alongside your tests:
services:
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: testpass
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
This is equivalent to running docker run with the same parameters, but managed by the CI platform.