gittools/gitversion

Sponsored OSS

By gittools

Updated 2 months ago

GitVersion Docker Images

Image
Integration & delivery
16

5M+

gittools/gitversion repository overview

GitVersion

GitVersion – From git log to SemVer in no time

Versioning when using Git, solved. GitVersion looks at your git history and works out the Semantic Version of the commit being built.

This repository contains the Docker images for GitVersion. Source code can be found at src

Usage

The recommended image to run is alpine, as they are the smallest Docker images we provide. This will execute GitVersion for the current working directory ($(pwd)) on Linux and Unix or powershell on Windows:

docker run --rm -v "$(pwd):/repo" gittools/gitversion:6.5.1-alpine.3.22-10.0 /repo

The following command will execute GitVersion for the current working directory (%CD%) on Windows with CMD:

docker run --rm -v "%CD%:/repo" gittools/gitversion:6.5.1-alpine.3.22-10.0 /repo

Note that the path /repo needs to be passed as an argument since the gitversion executable within the container is not aware of the fact that it's running inside a container.

CI Agents

If you are running GitVersion on a CI agent, you may need to specify environment variables to allow GitVersion to work correctly. For example, on Azure DevOps you may need to set the following environment variables:

docker run --rm -v "$(pwd):/repo" --env TF_BUILD=true --env BUILD_SOURCEBRANCH=$(Build.SourceBranch) gittools/gitversion:6.5.1-alpine.3.22-10.0 /repo

On GitHub Actions, you may need to set the following environment variables:

docker run --rm -v "$(pwd):/repo" --env GITHUB_ACTIONS=true --env GITHUB_REF=$(GITHUB_REF) gittools/gitversion:6.5.1-alpine.3.22-10.0 /repo
Tags

Most of the tags we provide have both arm64 and amd64 variants. If you need to pull a architecture specific tag you can do that like:

docker run --rm -v "$(pwd):/repo" gittools/gitversion:6.5.1-alpine.3.22-10.0-amd64 /repo
docker run --rm -v "$(pwd):/repo" gittools/gitversion:6.5.1-alpine.3.22-10.0-arm64 /repo

Tag summary

Content type

Image

Digest

sha256:d53b38ac5

Size

290.7 MB

Last updated

2 months ago

docker pull gittools/gitversion:6.5.1-centos.stream.9-8.0

This week's pulls

Pulls:

22,448

Last week