Advice on docker use in multiple shell executors on single machine

So I have one machine with a single gitlab-runner service and multiple shell runners on it for optimal usage of the resources.

I also build and push docker images in some steps and for this have the ‘docker login’ part of the documentation at the beginning of those steps.

Current problem:

It seems when a log of jobs run and the runner service is under load, steps of different jobs influence each other. For example Project 1 starts with docker login, then docker build, while the build is running Project 2 starts with docker login and seems to overwrite(?) the login credentials in the docker demon. Now when Project 1 docker build completes and it tries docker push it is unauthorized.

How do you work around this without creating multiple machines with a runner service and single executor each?
I also played with the docker executor and DIND but that seems even more of a nightmare to configure and manage.

Apparently they use different credentials then?
There are several storage mechanism for the docker credentials.

Depending on the on you use the solution may differ.
It could be as easy as not logging in again if the credentials are already set.
If there are different credentials you could work around the issue by using different aliases for the host that needs the different credentials.