D1: Service Containers
GH-200 GitHub Actions exam practice questions · 10 flashcards
Question
services: keyword?
1 / 10
Tip: Space flips the card, ← / → navigate.
Show all 10 Service Containers practice questions and answers
- services: keyword?Run sidecar containers (DB, cache, queue) for a job.
- Service containers require?Linux runners; Docker available (hosted Ubuntu or self-hosted Linux).
- Job in container vs on runner?If job runs in container:, services reachable by service name; on runner, via localhost and mapped ports.
- Mapping ports?ports: - 5432:5432.
- Health checks for services?options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5.
- Service env vars?env: POSTGRES_PASSWORD etc. on the service.
- Service credentials for private images?credentials: username/password.
- Accessing dynamic mapped port?${{ job.services.<name>.ports['5432'] }}.
- container: keyword?Run all job steps inside a specified container image.
- Scenario: integration tests need Redis. Config?services: redis: image: redis with ports 6379:6379 and health check.