Skip to content

Usability of docker image #1709

@pniederlag

Description

@pniederlag

The idea and approach of gitversion is very appealing in order to get some streamlined semVer tooling, thx for working on it.

However I really had a very hard time getting gitversion to run on linux. As there seems no easy road to get a linux compatible binary I decided to head out for docker.

Currently there are >1000 tags for the official image on hub.docker.com. As there is no overview it's hard to spot the right one to choose (basicly there seem to be 4.0.1 as well as 5.0.0 images for my favorite debian flavor).

Now came the tricky part plumbing all the switches and commands... here are my findings:

docker image has an entrypoint and workdir set to "/app", for this reason you must use some positional or named argument to set the path to the repo (which must be mounted as volume to the container). Whatever I never could get the init command to work. This seems kind of anoying to me. This is what I now ended up with(works for me):

docker run --rm -ti --name="gitversion" --volume="$(pwd)/.:/repo" --entrypoint="dotnet" -w "/repo" gittools/gitversion:4.0.1-linux-debian-netcoreapp2.1 /app/GitVersion.dll XXX

XXX can be init, /output json or any of the other switches.

From my point of view it might make sense to adapt the image in that direction. The gitversion command should be run in a way that is bulletproof and does not rely on the current working directory. instead the working-dir in the image should be set to /repo, and make this the expected default path where the repo should be made available to docker via volume mount.

Other than that I had to dig the source to find out that /output buildserver needs some environment variable JENKINS_URL in order to produce some results.

Thx for your efforts

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions