git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Docker image for git

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 25, 2017, 11:45 UTC
Message-ID
<alpine.DEB.2.21.1.1710251330320.6482@virtualbox>
In-Reply-To
<MAXPR0101MB146810B98D591DDDCA498EEA9B470@MAXPR0101MB1468.INDPRD01.PROD.OUTLOOK.COM>
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

Previous: Vaibhav Sood
Message 2 of 2 in “Docker image for git”
  1. Vaibhav SoodOct 24, 2017
  2. Johannes SchindelinOct 25, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.