Accessing a port of a pipeline run *from* a service

We’re building a (Spring Boot) application in our Gitlab pipeline, and are running some integration tests against the app as part of the pipeline.

The integration test client is running as a service and would need to connect to the app being currently built. The relevant part of the pipeline:

  stage: test
  image: $AWS_REGISTRY/fueling-backend-build-image
    - name: $AWS_REGISTRY/fueling-ifsf-mock:latest
      alias: ifsf-mock
    - cat /etc/hosts
    - ./gradlew --gradle-user-home $GRADLE_USER_HOME --stacktrace -PbuildVersion=$CI_COMMIT_SHORT_SHA test

(fueling-backend-build-image just being an OpenJDK image with gradle pre-installed)

We can access any port of the IFSF-Mock running as a service from the integration tests of the app being built, but the mock has to be able to make a callback (think webhook) to the app. Everythings working locally as expected, but the mock cannot connect in the pipeline.

I already tried:

  • docker

Last one is from the output cat /etc/hosts:	runner-8rxmqay-project-47-concurrent-0

Is this even possible?

Please note, that I’m not asking to access a port of the container running as a service (which is easy), but “the opposite direction”