From 4bbedab26f4e3c78acd77bd1712f9fe23fdedb4e Mon Sep 17 00:00:00 2001 From: Ales Buzhynsky Date: Thu, 26 Jan 2017 13:33:22 +0300 Subject: [PATCH 1/9] Add --no-install-recommends --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6d0f080..0a8f634 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ MAINTAINER Alexander Gavrilov RUN echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots 4.4.2.11/main" | tee /etc/apt/sources.list.d/mono-xamarin.list \ && echo "deb http://ftp.debian.org/debian sid main" | tee -a /etc/apt/sources.list \ && apt-get clean && apt-get update \ - && apt-get install -y unzip git libc6 libc6-dev libc6-dbg \ + && apt-get install -y --no-install-recommends unzip git libc6 libc6-dev libc6-dbg \ && rm -rf /var/lib/apt/lists/* /tmp/* # Install GitVersion From fbe151feae4b3f7191c289e4661f66a138c7c767 Mon Sep 17 00:00:00 2001 From: Ales Buzhynsky Date: Thu, 26 Jan 2017 14:11:48 +0300 Subject: [PATCH 2/9] Remove mounts and entrypoint --- Dockerfile | 10 +--------- README.md | 8 +------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0a8f634..dfd9fa5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ FROM mono -MAINTAINER Alexander Gavrilov - # Install software for GitVersion RUN echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots 4.4.2.11/main" | tee /etc/apt/sources.list.d/mono-xamarin.list \ && echo "deb http://ftp.debian.org/debian sid main" | tee -a /etc/apt/sources.list \ @@ -12,10 +10,4 @@ RUN echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots 4.4. # Install GitVersion RUN curl -Ls https://github.com/GitTools/GitVersion/releases/download/v4.0.0-beta.9/GitVersion.CommandLine.4.0.0-beta0009.nupkg -o tmp.zip \ && unzip -d /usr/lib/GitVersion tmp.zip \ - && rm tmp.zip - -WORKDIR /usr/lib/GitVersion/tools - -VOLUME ["/src"] - -ENTRYPOINT ["mono", "./GitVersion.exe", "/src"] \ No newline at end of file + && rm tmp.zip \ No newline at end of file diff --git a/README.md b/README.md index 1f303c1..3fb2bc1 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,4 @@ GitVersion is a tool to help you achieve *Semantic Versioning* on your project. -* [GitVersion Project homepage](https://github.com/GitTools/GitVersion) - -# How to use this image - -This image will run GitVersion Command Line tool. It expects the git rempository to be bound at /src - - $ docker run --rm -v "$PWD:/src" ilucker/gitversion /h \ No newline at end of file +* [GitVersion Project homepage](https://github.com/GitTools/GitVersion) \ No newline at end of file From 8372ef788467223b76fdfc283e8e52b3821f66ee Mon Sep 17 00:00:00 2001 From: Ales Buzhynsky Date: Thu, 16 Feb 2017 14:53:43 +0300 Subject: [PATCH 3/9] Add alias for GitVersion --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index dfd9fa5..25e6c5f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,4 +10,8 @@ RUN echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots 4.4. # Install GitVersion RUN curl -Ls https://github.com/GitTools/GitVersion/releases/download/v4.0.0-beta.9/GitVersion.CommandLine.4.0.0-beta0009.nupkg -o tmp.zip \ && unzip -d /usr/lib/GitVersion tmp.zip \ - && rm tmp.zip \ No newline at end of file + && rm tmp.zip + +RUN echo '#!/bin/bash\nexec mono /usr/lib/GitVersion/tools/GitVersion.exe "$@"' > /usr/bin/git-version + +RUN chmod +x /usr/bin/git-version From 3580cb214c6c54e7d4e8b0ca14e016104904a807 Mon Sep 17 00:00:00 2001 From: Erik Hvattum Date: Tue, 31 Oct 2017 11:15:07 +0100 Subject: [PATCH 4/9] Updated gitversion (#1) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2aea300..3ac782c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ RUN echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots 4.4. && rm -rf /var/lib/apt/lists/* /tmp/* # Install GitVersion -RUN curl -Ls https://github.com/GitTools/GitVersion/releases/download/v4.0.0-beta.9/GitVersion.CommandLine.4.0.0-beta0009.nupkg -o tmp.zip \ +RUN curl -Ls https://github.com/GitTools/GitVersion/releases/download/v4.0.0-beta.12/GitVersion.CommandLine.4.0.0-beta0012.nupkg -o tmp.zip \ && unzip -d /usr/lib/GitVersion tmp.zip \ && rm tmp.zip From be9bdc35603c626d8ac3549d416df1fe21b4abdd Mon Sep 17 00:00:00 2001 From: Erik Hvattum Date: Fri, 2 Mar 2018 15:32:33 +0100 Subject: [PATCH 5/9] removed arbitrary file --- MR_DockerGitVersion.xml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 MR_DockerGitVersion.xml diff --git a/MR_DockerGitVersion.xml b/MR_DockerGitVersion.xml deleted file mode 100644 index 7f7ecfb..0000000 --- a/MR_DockerGitVersion.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - Run GitVersion in a docker containter - - - - - - - - - - - - - - - - From 91bb8cfed31926b19b57ed9e5f417bd99ec48d27 Mon Sep 17 00:00:00 2001 From: Erik Hvattum Date: Fri, 2 Mar 2018 15:48:05 +0100 Subject: [PATCH 6/9] Defined a mount point and entry point. Basicly allowing the image to be run like: `docker run -v :/src -showvariable NugetVersion` --- Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index a489d52..c0161fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,21 @@ FROM mono +LABEL maintainer="Erik Hvattum " + # Install software for GitVersion RUN echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots 4.4.2.11/main" | tee /etc/apt/sources.list.d/mono-xamarin.list \ && echo "deb http://ftp.debian.org/debian sid main" | tee -a /etc/apt/sources.list \ && apt-get clean && apt-get update \ - && apt-get install -y --no-install-recommends unzip git libc6 libc6-dev libc6-dbg \ + && apt-get install -y unzip git libc6 libc6-dev libc6-dbg \ && rm -rf /var/lib/apt/lists/* /tmp/* # Install GitVersion RUN curl -Ls https://github.com/GitTools/GitVersion/releases/download/v4.0.0-beta.12/GitVersion.CommandLine.4.0.0-beta0012.nupkg -o tmp.zip \ && unzip -d /usr/lib/GitVersion tmp.zip \ && rm tmp.zip + +WORKDIR /usr/lib/GitVersion/tools -RUN echo '#!/bin/bash\nexec mono /usr/lib/GitVersion/tools/GitVersion.exe "$@"' > /usr/bin/git-version +VOLUME ["/src"] -RUN chmod +x /usr/bin/git-version +ENTRYPOINT ["mono", "./GitVersion.exe", "/src"] From 36bd58a33b7f4e860b59ae0102270d1cbe8bfbf9 Mon Sep 17 00:00:00 2001 From: Erik Hvattum Date: Mon, 5 Mar 2018 11:10:02 +0100 Subject: [PATCH 7/9] Changed base image and added a libgit2-patch Using base image from the maintainers of gitversion: https://github.com/GitTools/GitVersion/commit/fcdc1e7b7d0dfc20562fd72fa083dbe17a401a67. Added a patch for libgit2, sourced from the same dockerfile. --- Dockerfile | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index c0161fd..fff5673 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,11 @@ -FROM mono - +FROM gittools/libgit2sharp-mono LABEL maintainer="Erik Hvattum " -# Install software for GitVersion -RUN echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots 4.4.2.11/main" | tee /etc/apt/sources.list.d/mono-xamarin.list \ - && echo "deb http://ftp.debian.org/debian sid main" | tee -a /etc/apt/sources.list \ - && apt-get clean && apt-get update \ - && apt-get install -y unzip git libc6 libc6-dev libc6-dbg \ - && rm -rf /var/lib/apt/lists/* /tmp/* - -# Install GitVersion +# Install GitVersion 4 RUN curl -Ls https://github.com/GitTools/GitVersion/releases/download/v4.0.0-beta.12/GitVersion.CommandLine.4.0.0-beta0012.nupkg -o tmp.zip \ && unzip -d /usr/lib/GitVersion tmp.zip \ - && rm tmp.zip + && rm tmp.zip \ + && sed -i 's|lib/linux/x86_64|/usr/lib/GitVersion/lib/linux/x86_64|g' /usr/lib/GitVersion/LibGit2Sharp.dll.config WORKDIR /usr/lib/GitVersion/tools From bb082ed376ef227a7c0cc15d8c3b8d97f787b96a Mon Sep 17 00:00:00 2001 From: Erik Hvattum Date: Mon, 5 Mar 2018 11:17:25 +0100 Subject: [PATCH 8/9] Fixed path for file to be sed-ed --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fff5673..d1b8202 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ LABEL maintainer="Erik Hvattum " RUN curl -Ls https://github.com/GitTools/GitVersion/releases/download/v4.0.0-beta.12/GitVersion.CommandLine.4.0.0-beta0012.nupkg -o tmp.zip \ && unzip -d /usr/lib/GitVersion tmp.zip \ && rm tmp.zip \ - && sed -i 's|lib/linux/x86_64|/usr/lib/GitVersion/lib/linux/x86_64|g' /usr/lib/GitVersion/LibGit2Sharp.dll.config + && sed -i 's|lib/linux/x86_64|/usr/lib/GitVersion/lib/linux/x86_64|g' /usr/lib/GitVersion/tools/LibGit2Sharp.dll.config WORKDIR /usr/lib/GitVersion/tools From 5a7e0d1eac7b20f69ef25ddd84e68c85824f247c Mon Sep 17 00:00:00 2001 From: Erik Hvattum Date: Mon, 5 Mar 2018 11:48:16 +0100 Subject: [PATCH 9/9] Fixed yet another error in the sed script. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d1b8202..b5e2648 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ LABEL maintainer="Erik Hvattum " RUN curl -Ls https://github.com/GitTools/GitVersion/releases/download/v4.0.0-beta.12/GitVersion.CommandLine.4.0.0-beta0012.nupkg -o tmp.zip \ && unzip -d /usr/lib/GitVersion tmp.zip \ && rm tmp.zip \ - && sed -i 's|lib/linux/x86_64|/usr/lib/GitVersion/lib/linux/x86_64|g' /usr/lib/GitVersion/tools/LibGit2Sharp.dll.config + && sed -i 's|lib/linux/x86_64|/usr/lib/GitVersion/tools/lib/linux/x86_64|g' /usr/lib/GitVersion/tools/LibGit2Sharp.dll.config WORKDIR /usr/lib/GitVersion/tools