A job defines a service container with key 'redis'. From a step running on the job's runner (not inside a job container), how do you typically reach Redis on port 6379?
Select an answer to reveal the explanation.
Short Explanation and Infographic
When the job runs directly on the VM (no job container), service ports are published to localhost. The service keyword hostname is for communication from a job container network.
Full explanation below image
Full Explanation
Service containers behave differently depending on whether the job itself runs in a container. If the job uses runs-on with steps on the host VM, Docker publishes the service ports to the host, so clients use localhost:6379 (or 127.0.0.1). If the job also specifies container:, the job container and service containers join a user-defined bridge network and reach each other by service label hostnames such as redis. The wrong answers mix these modes: hostname redis works in the job-container networking mode, not the host-VM mode the question describes. services.redis and docker.internal are not the standard documented hostnames for this pattern. Always map ports under services.redis.ports (for example 6379:6379) when you need host access to the service.