Skip to content

Commit 1ee1193

Browse files
committed
Add documentation for Docker usage
1 parent 8746750 commit 1ee1193

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/input/docs/usage/docker.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
Order: 50
3+
Title: Docker
4+
Description: |
5+
Use GitVersion through one of its many published Docker containers.
6+
---
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:
12+
13+
```shell
14+
docker run --rm --volume "$(pwd):/repo" gittools/gitversion:6.0.0-fedora.36-6.0 /repo
15+
```
16+
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.
21+
22+
The `--rm` flag will remove the container after it has finished
23+
running.
24+
25+
[Explore GitVersion on Docker Hub][docker-hub]{.btn .btn-primary}
26+
27+
[docker-hub]: https://hub.docker.com/r/gittools/gitversion

0 commit comments

Comments
 (0)