From 001a42f256919832e4b4e4fe481018a36f577ba8 Mon Sep 17 00:00:00 2001 From: "mr.exz" Date: Sun, 20 Jan 2019 01:16:50 +0300 Subject: [PATCH 1/4] updated readme added Dockerfile with clear cenots/7,dotnet core 2.2, gitversion 4.0.0 --- src/Docker/Readme.md | 4 +++- src/Docker/linux/centos/Dockerfile | 32 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 src/Docker/linux/centos/Dockerfile diff --git a/src/Docker/Readme.md b/src/Docker/Readme.md index 6aecca9f86..13cc46907e 100644 --- a/src/Docker/Readme.md +++ b/src/Docker/Readme.md @@ -1,9 +1,10 @@ -# There are 4 variants of docker image : +# There are 5 variants of docker image : - based on **microsoft/dotnet-framework:4.7.2-runtime** - Windows Full FX - based on **microsoft/dotnet:2.1-runtime** - Windows dotnet core - based on **microsoft/dotnet-framework:4.7.2-runtime** - linux Full FX - on mono - based on **microsoft/dotnet:2.1-runtime** - linux dotnet core +- based on **cenots:7** - linux dotnet core To run on windows container run this `docker run --rm -v "$(pwd):c:/repo" gittools/gitversion-fullfx:windows-4.0.0 c:/repo` @@ -14,3 +15,4 @@ To run on linux container run this `docker run --rm -v "$(pwd):/repo" gittools/gitversion-fullfx:linux-4.0.0 /repo` `docker run --rm -v "$(pwd):/repo" gittools/gitversion-dotnetcore:linux-4.0.0 /repo` + diff --git a/src/Docker/linux/centos/Dockerfile b/src/Docker/linux/centos/Dockerfile new file mode 100644 index 0000000000..9d1ff9aa2f --- /dev/null +++ b/src/Docker/linux/centos/Dockerfile @@ -0,0 +1,32 @@ +FROM centos:7 +HEALTHCHECK NONE + +ENV DOTNET_VERSION='2.2' \ + GITVERSION_URL='https://github.com/GitTools/GitVersion/releases/download/v4.0.0/GitVersion-bin-coreclr-v4.0.0.zip' \ + GITVERSION_HOME=/opt/gitversion \ + GITVERSION_BIN=/usr/bin/gitversion + +# https://dotnet.microsoft.com/download/linux-package-manager/rhel/sdk-current +RUN rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm \ + && yum update cache + +# if you need SDK use dotnet-sdk-$DOTNET_VERSION +RUN yum install -y dotnet-runtime-$DOTNET_VERSION.x86_64 unzip libgit2-devel.x86_64 \ + && yum clean all + +# https://github.com/GitTools/GitVersion +RUN mkdir $GITVERSION_HOME \ + && cd $GITVERSION_HOME \ + && curl -L -o "gitversion.zip" $GITVERSION_URL\ + && unzip gitversion.zip \ + && rm -f gitversion.zip \ + && ln -s /usr/lib64/libgit2.so /usr/lib64/libgit2-15e1193.so + + +RUN echo "#!/usr/bin/env bash" > $GITVERSION_BIN \ + && echo "dotnet $GITVERSION_HOME/GitVersion.dll \$@" >> $GITVERSION_BIN \ + && chmod +x $GITVERSION_BIN + +WORKDIR /app + +ENTRYPOINT ["gitversion"] \ No newline at end of file From 23c8f65bef3da4147418f4f67923c70d12528a82 Mon Sep 17 00:00:00 2001 From: "mr.exz" Date: Mon, 21 Jan 2019 22:49:27 +0300 Subject: [PATCH 2/4] add build docker image in build process --- build.cake | 2 ++ src/Docker/linux/centos/Dockerfile | 27 ++++++++------------------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/build.cake b/build.cake index 5bb238ee52..eb33ea6d8d 100644 --- a/build.cake +++ b/build.cake @@ -399,6 +399,7 @@ Task("Docker-Build") { DockerBuild("linux", "dotnetcore", parameters); DockerBuild("linux", "fullfx", parameters); + DockerBuild("linux", "centos", parameters); } }); @@ -622,6 +623,7 @@ Task("Publish-DockerHub") { DockerPush("linux", "dotnetcore", parameters); DockerPush("linux", "fullfx", parameters); + DockerPush("linux", "centos", parameters); } DockerLogout(); diff --git a/src/Docker/linux/centos/Dockerfile b/src/Docker/linux/centos/Dockerfile index 9d1ff9aa2f..0058ae1afa 100644 --- a/src/Docker/linux/centos/Dockerfile +++ b/src/Docker/linux/centos/Dockerfile @@ -1,10 +1,8 @@ FROM centos:7 -HEALTHCHECK NONE +LABEL maintainers="GitTools Maintainers" -ENV DOTNET_VERSION='2.2' \ - GITVERSION_URL='https://github.com/GitTools/GitVersion/releases/download/v4.0.0/GitVersion-bin-coreclr-v4.0.0.zip' \ - GITVERSION_HOME=/opt/gitversion \ - GITVERSION_BIN=/usr/bin/gitversion +ENV DOTNET_VERSION='2.2' +ARG contentFolder # https://dotnet.microsoft.com/download/linux-package-manager/rhel/sdk-current RUN rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm \ @@ -12,21 +10,12 @@ RUN rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-pro # if you need SDK use dotnet-sdk-$DOTNET_VERSION RUN yum install -y dotnet-runtime-$DOTNET_VERSION.x86_64 unzip libgit2-devel.x86_64 \ - && yum clean all + && yum clean all \ + && rm -rf /tmp/* -# https://github.com/GitTools/GitVersion -RUN mkdir $GITVERSION_HOME \ - && cd $GITVERSION_HOME \ - && curl -L -o "gitversion.zip" $GITVERSION_URL\ - && unzip gitversion.zip \ - && rm -f gitversion.zip \ - && ln -s /usr/lib64/libgit2.so /usr/lib64/libgit2-15e1193.so - - -RUN echo "#!/usr/bin/env bash" > $GITVERSION_BIN \ - && echo "dotnet $GITVERSION_HOME/GitVersion.dll \$@" >> $GITVERSION_BIN \ - && chmod +x $GITVERSION_BIN +RUN ln -s /usr/lib64/libgit2.so /usr/lib64/libgit2-15e1193.so WORKDIR /app +COPY $contentFolder/ ./ -ENTRYPOINT ["gitversion"] \ No newline at end of file +ENTRYPOINT ["dotnet", "GitVersion.dll"] \ No newline at end of file From 3c1f783845921345862b21e853cd6a67e1cc9d66 Mon Sep 17 00:00:00 2001 From: "mr.exz" Date: Tue, 22 Jan 2019 12:29:12 +0300 Subject: [PATCH 3/4] fix dotnet version --- src/Docker/linux/centos/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Docker/linux/centos/Dockerfile b/src/Docker/linux/centos/Dockerfile index 0058ae1afa..232b07ac9c 100644 --- a/src/Docker/linux/centos/Dockerfile +++ b/src/Docker/linux/centos/Dockerfile @@ -1,7 +1,7 @@ FROM centos:7 LABEL maintainers="GitTools Maintainers" -ENV DOTNET_VERSION='2.2' +ENV DOTNET_VERSION='2.1' ARG contentFolder # https://dotnet.microsoft.com/download/linux-package-manager/rhel/sdk-current From 6a127c386cbbba26c986e435d3c4c8fe92c8cd1d Mon Sep 17 00:00:00 2001 From: "mr.exz" Date: Mon, 4 Mar 2019 22:39:32 +0300 Subject: [PATCH 4/4] added fedora dockerfile and move to proper folder --- build.cake | 6 ++++-- .../netcoreapp2.1}/Dockerfile | 0 .../linux/fedora27/netcoreapp2.1/Dockerfile | 20 +++++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) rename src/Docker/linux/{centos => centos7/netcoreapp2.1}/Dockerfile (100%) create mode 100644 src/Docker/linux/fedora27/netcoreapp2.1/Dockerfile diff --git a/build.cake b/build.cake index 9ff2737395..d3cc29b1da 100644 --- a/build.cake +++ b/build.cake @@ -419,7 +419,8 @@ Task("Docker-Build") { DockerBuild("linux", "debian", "netcoreapp2.1", parameters); DockerBuild("linux", "debian", "net472", parameters); - DockerBuild("linux", "centos", "netcoreapp2.1", parameters); + DockerBuild("linux", "centos7", "netcoreapp2.1", parameters); + DockerBuild("linux", "fedora27", "netcoreapp2.1", parameters); } }); @@ -638,7 +639,8 @@ Task("Publish-DockerHub") { DockerPush("linux", "debian", "netcoreapp2.1", parameters); DockerPush("linux", "debian", "net472", parameters); - DockerPush("linux", "centos", "netcoreapp2.1", parameters); + DockerPush("linux", "centos7", "netcoreapp2.1", parameters); + DockerPush("linux", "fedora27", "netcoreapp2.1", parameters); } DockerLogout(); diff --git a/src/Docker/linux/centos/Dockerfile b/src/Docker/linux/centos7/netcoreapp2.1/Dockerfile similarity index 100% rename from src/Docker/linux/centos/Dockerfile rename to src/Docker/linux/centos7/netcoreapp2.1/Dockerfile diff --git a/src/Docker/linux/fedora27/netcoreapp2.1/Dockerfile b/src/Docker/linux/fedora27/netcoreapp2.1/Dockerfile new file mode 100644 index 0000000000..c97acb7606 --- /dev/null +++ b/src/Docker/linux/fedora27/netcoreapp2.1/Dockerfile @@ -0,0 +1,20 @@ +FROM fedora:27 +LABEL maintainers="GitTools Maintainers" + +ENV DOTNET_VERSION='2.1' +ARG contentFolder + +# https://dotnet.microsoft.com/download/linux-package-manager/rhel/sdk-current +RUN rpm -Uvh https://packages.microsoft.com/config/fedora/27/packages-microsoft-prod.rpm + +# if you need SDK use dotnet-sdk-$DOTNET_VERSION +RUN yum install -y dotnet-runtime-$DOTNET_VERSION.x86_64 unzip libgit2-devel.x86_64 \ + && yum clean all \ + && rm -rf /tmp/* + +RUN ln -s /usr/lib64/libgit2.so /usr/lib64/libgit2-15e1193.so + +WORKDIR /app +COPY $contentFolder/ ./ + +ENTRYPOINT ["dotnet", "GitVersion.dll"] \ No newline at end of file