DirectorySecurity advisories
Sign in

Directory

git logo

git

Last changed
Get started with latest for free
docker pull cgr.dev/chainguard/git

Need access to a specific version? Contact us.

Sign in for updates

Get notified of upcoming product changes, critical vulnerability notifications and patches and more.

Sign in
Versions
Overview
Provenance
Specifications
SBOM
Vulnerabilities
Advisories

A minimal Git image.

Download this Image

The image is available on cgr.dev:

docker pull cgr.dev/chainguard/git:latest

Note that there is also glibc version of this Image available:

docker pull cgr.dev/chainguard/git:latest-glibc

Upcoming Changes

On July 15, 2024 several images in this repository will move from a Alpine base to a Wolfi base, in-line with all other images in our registry. We do not expect this to cause breakages, but encourage all users to test and verify the new versions.

The affected tags are:

  • latest
  • latest-root
  • latest-dev
  • latest-root-dev

You can test today by migrating to one of the following images:

  • latest-glibc
  • latest-glibc-root
  • latest-glibc-dev
  • latest-glibc-root-dev

From July 15 the glibc tag and the corresponding tag without glibc will point to the same images.

Full details are in this blog post.

Usage

Chainguard's 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 version of the Image available, start by running a docker pull command:

docker pull cgr.dev/chainguard/git

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

docker run -it --rm cgr.dev/chainguard/git --version

You will receive output similar to this:

git version 2.43.0

Cloning a Repository Locally

Because your local system user's unique identifier might differ from that of the container, you'll need to set up special permissions for the target directory if you want to use this Image to clone repositories locally. Once you've configured these permissions, you'll be able to set up a volume and have the contents of the cloned repository 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 git clone command, using the directory you just set up as a volume shared between your local machine and the container Image:

docker run -it -v ~/workspace:/home/git --rm cgr.dev/chainguard/git clone https://github.com/chainguard-images/.github.git

Here, the volume is mounted to the /home/git directory in the container.

This will return output like the following:

Cloning into '.github'...
remote: Enumerating objects: 251, done.
remote: Counting objects: 100% (33/33), done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 251 (delta 15), reused 22 (delta 10), pack-reused 218
Receiving objects: 100% (251/251), 216.59 KiB | 1.04 MiB/s, done.
Resolving deltas: 100% (88/88), done.

You can now check the contents of your workspace directory, where you will find the cloned repository:

ls -a ~/workspace/
.  ..  .github
Licenses

Chainguard Images contain software packages that are direct or transitive dependencies. The following licenses were found in the "latest" version of this image:

  • Apache-2.0

  • BSD-3-Clause

  • GPL-2.0-or-later

  • ISC

  • LGPL-2.1-or-later

  • LGPL-3.0-or-later

  • MIT

View more

For a complete list of licenses, please refer to this Image's SBOM.

Software license agreement

Category
application
tools

Products

Chainguard Images

© 2024 Chainguard, Inc.