threads / discuss / 47018

Docker image for git

Subject: Docker image for git

## tl;dr

2 messages between Oct 24, 2017 and Oct 25, 2017.

replies: 1people: 2as markdown or json

Vaibhav Sood· Oct 24, 2017, 10:38 UTC · lore
Hi,
Want to check if there is a docker image/Dockerfile for git which is officially supported? I could not find one under dockerhub official images https://hub.docker.com/explore/
If not, want to check if there is any plan to add an official git image to dockerhub? https://docs.docker.com/docker-hub/official_repos/#how-do-i-create-a-new-official-repository

DISCLAIMER ========== This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

Johannes Schindelin· Oct 25, 2017, 11:45 UTC · re: Vaibhav Sood · lore

Re: Docker image for git

Hi,
On Tue, 24 Oct 2017, Vaibhav Sood wrote:
> Want to check if there is a docker image/Dockerfile for git which is
> officially supported?
No I don't want to ;-)
You probably meant to say that you wanted to check that?
> I could not find one under dockerhub official images
> https://hub.docker.com/explore/

I do not think that there is one official Git image. You also have to be more precise than that: do you mean a Linux-based image or a Windows-based one?

As far as a Docker image with Git in it: I do not think that this image itself would be useful. So you can fetch Git repositories? What then?

What most developers do who need Git in their Docker image is to start with the other requirements: typically a toolchain such as GCC. Or even a stack such as LAMP or MEAN.

Personally, I use Docker images as base for the build agents used to perform a few tasks in the Git for Windows project, so they start with the bare-bones Windows image, add the Visual Studio Team Services build agent, and then take things from there.

So essentially, I do not think that having a base image just with Git would be useful. It is much more useful to *add* Git to other base images, and that is easily done:

Linux (Ubuntu/Debian):
	sudo apt-get install git
Windows:
	$Version = "2.14.3"
	$Base = "https://github.com/git-for-windows/git/releases/download/v"
	$Url = $Base + $Version + "MinGit-" + $Version + "-64-bit.zip"
	$Path = "$HOME\Downloads\MinGit.zip"
	$Dir = "$HOME\MinGit"
	$WebClient = New-Object System.Net.WebClient
	$WebClient.DownloadFile($Url, $Path)
	Add-Type -AssemblyName System.IO.Compression.FileSystem
	[System.IO.Compression.ZipFile]::ExtractToDirectory($Path, $Dir)

Ciao, Johannes

← back to recent threads