Extract shared docker code into a base class
What does this MR do?
Refactors shared docker code to make it more maintainable and easier to add new services.
Required before changes for gitlab-org/quality/testcases#220 (closed), which will include a new service to run npm
in a docker container.