Image Overview: git

ReferenceChainguard ImagesProduct


latest2, 2.40, 2.40.0, 2.40.0-r0
latest-rootroot-2, root-2.40, root-2.40.0, root-2.40.0-r0
latest-glibcglibc-2, glibc-2.40, glibc-2.40.0, glibc-2.40.0-r0
latest-glibc-rootglibc-root-2, glibc-root-2.40, glibc-root-2.40.0, glibc-root-2.40.0-r0

This is a minimal Git image based. The image contains git, git-lfs, and supporting libraries such as openssh (for ssh-based auth), and ca-certs (for https-based cloning). Both Wolfi (glibc) and Alpine (musl) versions are available.

Get It!

The image is available on

docker pull

Or for the glibc version:

docker pull


The Git image allows you to run ordinary Git commands in CI/CD pipelines and also locally via Docker.

Docker Setup

To make sure you have the latest image version available, start by running a docker pull command:

docker pull

Then, run the image with the --version flag to make sure it is functional:

docker run -it --rm --version

You should get output similar to this:

git version 2.37.1

Cloning a Repository Locally

Because your local system user’s ID (uid) might differ from that of the container image, if you want to clone repositories locally using this image you’ll need to set up special permissions for the target dir. Then, you’ll be able to set up a volume and have the contents of the cloned repo replicated on your host machine.

First, create a target directory somewhere in your home folder and set the required permissions:

mkdir ~/workspace
chmod go+wrx ~/workspace

Now you can use docker run to execute the clone command, using the directory you just set up as a volume share between your local machine and the container image on /home/git.

docker run -it -v ~/workspace:/home/git --rm clone

You should get output like this:

Cloning into 'git'...
remote: Enumerating objects: 57, done.
remote: Counting objects: 100% (57/57), done.
remote: Compressing objects: 100% (47/47), done.
remote: Total 57 (delta 19), reused 35 (delta 10), pack-reused 0
Receiving objects: 100% (57/57), 15.23 KiB | 866.00 KiB/s, done.
Resolving deltas: 100% (19/19), done.

You can now check the contents of your workspace directory, where you should find the cloned repo.