Access stdout logs of the service image from the base image

I have a CI where I spawn a docker image as a service which I need to run some tests (Gitlab services).
Locally this service image is launched using docker-compose and I can access logs on stdout using the following shell command:

docker logs --tail all localstack 2>&1 | grep ...

This allows me to wait for the services to become online so I can run tests safely. I need to do the same thing on the Gitlab CI, but I am not sure how I can access the stdout logs of the service image from the base image.
Is there any way to do it?