How to create and re-use the same container of the image using services keyword

  • What are you seeing, and how does that differ from what you expect to see?

When I run my test jobs in parallel, I want to use the “services” keyword and be able to attach the same container to each test job. I have an API image that gives access to DB data for all my test jobs. Now Gitlab CI creates a new container with my API image for every job. I would like to know how to have the same instance attached to every job since I don’t need multiple containers of my API running.
Maybe for this purpose, I should use a different approach. Please advise if so.

  • Consider including screenshots, error messages, and/or other helpful visuals
  • What version are you on? Are you using self-managed or

Self-managed in azure cloud

  • What troubleshooting steps have you already taken? Can you link to any docs or other resources so we know where you have been?

I read all articles on services in Gitlab CI and seems like there is no way around having only one service container for every job in the pipeline but I maybe wrong