CICD-129 · Test service-name DNS inside Compose
Encyclopedia · Docker runtime and Compose · All snippets
Previous · CICD-128 · Next · CICD-130
1. Where it fits
- Placement Bash run step following checkout, or equivalent lab terminal.
- Prerequisites disposable Docker or Compose project with example web service.
- Platforms local-linux, github-actions, gitea-actions.
2. Copy the snippet
bash
docker compose exec -T web getent ahosts db3. How it works
The command executes inside an already-running service container using that service's network and runtime state. The command resolves the name using the configured system name service of the machine or container running the step.
4. Verify the result
Check from the service namespace. Compose network names are resolved inside that network.
Validation syntax-validated (Bash parse). Status definitions.