You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The recommended image to run is `alpine`, as they are the smallest Docker images we provide (83 MB). This will execute GitVersion for the current working directory (`$(pwd)`) on Linux and Unix or powershell on Windows:
67
+
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:
67
68
68
69
```sh
69
70
docker run --rm -v "$(pwd):/repo" gittools/gitversion:{tag} /repo
70
71
```
72
+
71
73
The following command will execute GitVersion for the current working directory (`%CD%`) on Windows with CMD:
72
74
73
75
```sh
74
76
docker run --rm -v "%CD%:/repo" gittools/gitversion:{tag} /repo
75
77
```
78
+
76
79
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.
77
80
81
+
### CI Agents
82
+
83
+
If you are running GitVersion on a CI agent, you may need to specify environment variables to allow GitVersion to work correctly.
84
+
For example, on Azure DevOps you may need to set the following environment variables:
Copy file name to clipboardExpand all lines: docs/input/docs/usage/docker.md
+35-12Lines changed: 35 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -5,22 +5,45 @@ Description: |
5
5
Use GitVersion through one of its many published Docker containers.
6
6
---
7
7
8
-
GitVersion can be used through one of its many published Docker
9
-
containers. The list of available containers can be found on
10
-
[Docker Hub][docker-hub]. Once you've found the image you want to use,
11
-
you can run it like this:
8
+
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:
12
9
13
-
```shell
14
-
docker run --rm --volume"$(pwd):/repo" gittools/gitversion:6.0.0-fedora.36-6.0 /repo
10
+
```sh
11
+
docker run --rm -v"$(pwd):/repo" gittools/gitversion:{tag} /repo
15
12
```
16
13
17
-
The above command will run GitVersion with the current directory
18
-
mapped to `/repo` inside the container (the `--volume "$(pwd):/repo"`
19
-
part). The `/repo` directory is then passed in as the argument
20
-
GitVersion should use to calculate the version.
14
+
The following command will execute GitVersion for the current working directory (`%CD%`) on Windows with CMD:
21
15
22
-
The `--rm` flag will remove the container after it has finished
23
-
running.
16
+
```sh
17
+
docker run --rm -v "%CD%:/repo" gittools/gitversion:{tag} /repo
18
+
```
19
+
20
+
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.
21
+
22
+
### CI Agents
23
+
24
+
If you are running GitVersion on a CI agent, you may need to specify environment variables to allow GitVersion to work correctly.
25
+
For example, on Azure DevOps you may need to set the following environment variables:
0 commit comments