A job defines a Redis service container. Which configuration correctly maps port 6379 and waits for the service to be ready?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Service containers use image, ports, env, and Docker options (including health checks). They are not marketplace actions and are not configured under runs-on.
Full explanation below image
Full Explanation
jobs.<job_id>.services.<service_id> defines sidecar containers. Specify image, ports (host:container or container port mappings as documented), env, and options for health checks so jobs do not race the database. The job reaches the service hostname by service id (e.g., redis) on the Docker network when running in containers; on GitHub-hosted Ubuntu, localhost mapped ports are commonly used for non-container jobs. uses: is for actions, not services. runs-on selects the runner VM/image. Pulling manually in steps bypasses the integrated service lifecycle.