Reputation: 9950
I am setting up a Git repository for my team on a remote machine. We've been trying to Dockerize as many parts of our infrastructure as possible, (such as Jenkins) but I am not seeing the point in Dockerizing our Git repository.
We would still be using the SSH deamon on the host machine for actually receiving the inbound Git push/pull requests. It seems the only purpose the Git Docker container would serve would be to provide the Git executable somehow to the host. The Git repo itself would be kept in a Docker volume mounted on the filesystem regardless so that doesn't seem to benefit from Dockerization anyway.
I am thinking this is simply not a good use case for Docker and that we should just install Git on the machine normally. Does anybody else have any thoughts of insights they can share on this?
Upvotes: 0
Views: 305
Reputation: 1535
As another commenter pointed out, Git doesn't run as a service. However, running Gitlab or sshd with Git in a container doesn't seem unreasonable. Something to keep in mind is that as you deploy more and more containers, your infrastructure is going to be designed support that, so it will likely be desirable to deploy as much as possible in containers, even something like Git, since the few services that you maintain on separate hosts will become "special" and require more work to maintain.
Upvotes: 0
Reputation: 312370
In general, you dockerize services. A git repository isn't a "service".
If you were running some git repository hosting software (like Gitlab) you could dockerize that, but asking "should I dockerize my git repository?" is a bit like asking "should I dockerize my Word document?" Sure, you could put it in a container, but it's not clear that would bring you any advantages.
A more common integration point between Docker and Git is using Docker containers to run tests on your source code (so that you have a controlled environment for running a tests).
Upvotes: 3