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
My colleague and I spent nearly a day trying to narrow down the error. So a clear error message instead of a non-systematic crash would have made a huge difference. Thanks.
It would be great to do something like that. But it sounds like a PITA to maintain a list of supported operating systems for another software project. If LibGit2Sharp had a list we could use, this would be no problem. But unfortunately they don't afaik.
I have tried to use gittools/gitversion:latest-linux-netcoreapp2.1 and it does work successfully.
That being said, it's a little painfull to download a 341 MB docker image instead of the 1 MB dotnet-gitversion global tool. It does slow down our build process that has to download all this before being able to run gitversion.
I understand your pain, but our alpine images are only 89MB and with caching in place, docker pull should not have to re-download the image on every run.
@asbjornu I see that you have updated the README of the docker images to refer to gittools/gitversion:5.3.5-linux-alpine.3.10-x64-netcoreapp3.1 instead of latest-linux-netcoreapp2.1. I do see a signficant change in size:
REPOSITORY TAG IMAGE ID CREATED SIZE
gittools/gitversion 5.3.5-linux-alpine.3.10-x64-netcoreapp3.1 6beafce0301e 3 days ago 183MB
gittools/gitversion latest-linux-netcoreapp2.1 f2e60a3cf5c8 2 months ago 341MB
Note that I see a size of 183 MB and not 89 MB. I guess you meant that you only add 89 MB on top of the alpine image.
Thanks again for your support. It does minimize the pain to to have a smaller image ;)
Thanks @asbjornu I could but I just found out that the oficial mcr.microsoft.com/dotnet/sdk:5.0 (not the 5.0-alpine) works great with GitVersion.MsBuild 5.6.4.
I'm not using GitVersion.MsBuild 5.6.6 because of this: #2590 (comment)
Segmentation fault (core dumped) /root/.nuget/packages/gitversion.msbuild/5.6.4/tools/GitVersion.MsBuild.targets(9,9): error MSB3073: The command "dotnet --roll-forward Major "/root/.nuget/packages/gitversion.msbuild/5.6.4/tools/netcoreapp3.1/gitversion.dll" "/src/src/GUI/PMCM" -output file -outputfile obj/gitversion.json" exited with code 139.
Dont know why 'netcoreapp3.1' path, my project is set to net5.0, GitVersion.MsBuild 5.6.4
Docker image: mcr.microsoft.com/dotnet/sdk:5.0-alpine
I have the same issue.
Tried to use gittools/gitversion:5.6.7-alpine.3.12-x64-5.0 but got the error: "Cannot find the .git directory" (GitLab-CI)
and even if I use mcr.microsoft.com/dotnet/sdk:5.0 which works correctly dotnet build commands executed in alpine fails with the same reason:
Segmentation fault (core dumped)
/home/build/.nuget/packages/gitversion.msbuild/5.6.6/tools/GitVersion.MsBuild.targets(9,9): error MSB3073: The command "dotnet --roll-forward Major "/home/build/.nuget/packages/gitversion.msbuild/5.6.6/tools/netcoreapp3.1/gitversion.dll" "/builds/ ... SOURCE_PATH" -output file -outputfile obj/gitversion.json" exited with code 139.
@vadym fyi: this is my (now working) Dockerfile
I emphasize that I am using GitVersion.MsBuild pinned in version 5.6.4 due to a bug in the version 5.6.5 and above.
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
# copy files to container
COPY *.sln .
COPY nuget.config .
COPY GitVersion.yml .
COPY src/. ./src/
COPY .git/ ./.git/
# build and publish
RUN dotnet restore
RUN dotnet publish src/Presentation/PMCM/PMCM.csproj -c release -o /app --no-restore
# final stage image
FROM mcr.microsoft.com/dotnet/aspnet:5.0
WORKDIR /app
# install System.Drawing native dependencies
# https://github.com/dotnet/dotnet-docker/blob/master/documentation/scenarios/using-system-drawing-common.md
RUN apt-get update \
&& apt-get install -y --no-install-recommends --allow-unauthenticated \
libc6-dev \
libgdiplus \
libx11-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install fonts
RUN sed -i'.bak' 's/$/ contrib/' /etc/apt/sources.list
RUN apt-get update \
&& apt-get install -y --no-install-recommends ttf-mscorefonts-installer fontconfig \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN fc-cache -f -v
COPY --from=build /app ./
ARG APP_ENVIRONMENT='Development'
ENV ASPNETCORE_ENVIRONMENT $APP_ENVIRONMENT
ENV ASPNETCORE_FORWARDEDHEADERS_ENABLED "true"
ENTRYPOINT ["dotnet", "PMCM.dll"]
Activity
asbjornu commentedon Jun 2, 2020
Please see #2260 (comment). Debian/Ubuntu is unsupported by LibGit2Sharp. Use one of our official Docker images instead.
mabead commentedon Jun 2, 2020
Thanks @asbjornu . Would it possible to fail early with an error message that says something like "Debian/Ubuntu is unsupported by LibGit2Sharp. Use one of our official Docker images instead (https://hub.docker.com/r/gittools/gitversion)"?
My colleague and I spent nearly a day trying to narrow down the error. So a clear error message instead of a non-systematic crash would have made a huge difference. Thanks.
asbjornu commentedon Jun 2, 2020
I would love to do that, but as I wrote in #2260 (comment):
mabead commentedon Jun 2, 2020
I have tried to use
gittools/gitversion:latest-linux-netcoreapp2.1and it does work successfully.That being said, it's a little painfull to download a 341 MB docker image instead of the 1 MB
dotnet-gitversionglobal tool. It does slow down our build process that has to download all this before being able to run gitversion.asbjornu commentedon Jun 2, 2020
I understand your pain, but our
alpineimages are only 89MB and with caching in place,docker pullshould not have to re-download the image on every run.mabead commentedon Jun 2, 2020
@asbjornu I see that you have updated the README of the docker images to refer to
gittools/gitversion:5.3.5-linux-alpine.3.10-x64-netcoreapp3.1instead oflatest-linux-netcoreapp2.1. I do see a signficant change in size:Note that I see a size of 183 MB and not 89 MB. I guess you meant that you only add 89 MB on top of the alpine image.
Thanks again for your support. It does minimize the pain to to have a smaller image ;)
asbjornu commentedon Jun 2, 2020
I may have looked at "compressed size" on hub.docker.com and also remember the size wrong.
dejoost commentedon Nov 17, 2020
managed to run it on ubuntu bionic (mcr.microsoft.com/dotnet/sdk:3.1-bionic
luis-fss commentedon Feb 9, 2021
Segmentation fault (core dumped) /root/.nuget/packages/gitversion.msbuild/5.6.4/tools/GitVersion.MsBuild.targets(9,9): error MSB3073: The command "dotnet --roll-forward Major "/root/.nuget/packages/gitversion.msbuild/5.6.4/tools/netcoreapp3.1/gitversion.dll" "/src/src/GUI/PMCM" -output file -outputfile obj/gitversion.json" exited with code 139.Dont know why 'netcoreapp3.1' path, my project is set to net5.0, GitVersion.MsBuild 5.6.4
Docker image: mcr.microsoft.com/dotnet/sdk:5.0-alpine
asbjornu commentedon Feb 9, 2021
@Lukkian, can you please use one of the official GitVersion Docker images, such as
gittools/gitversion:5.6.6?luis-fss commentedon Feb 9, 2021
Thanks @asbjornu I could but I just found out that the oficial
mcr.microsoft.com/dotnet/sdk:5.0(not the 5.0-alpine) works great with GitVersion.MsBuild 5.6.4.I'm not using GitVersion.MsBuild 5.6.6 because of this: #2590 (comment)
vadym commentedon Mar 18, 2021
I have the same issue.
Tried to use gittools/gitversion:5.6.7-alpine.3.12-x64-5.0 but got the error: "Cannot find the .git directory" (GitLab-CI)
and even if I use mcr.microsoft.com/dotnet/sdk:5.0 which works correctly dotnet build commands executed in alpine fails with the same reason:
Segmentation fault (core dumped)
/home/build/.nuget/packages/gitversion.msbuild/5.6.6/tools/GitVersion.MsBuild.targets(9,9): error MSB3073: The command "dotnet --roll-forward Major "/home/build/.nuget/packages/gitversion.msbuild/5.6.6/tools/netcoreapp3.1/gitversion.dll" "/builds/ ... SOURCE_PATH" -output file -outputfile obj/gitversion.json" exited with code 139.
Project has been configured to use dotnet 5.0.
luis-fss commentedon Mar 18, 2021
@vadym fyi: this is my (now working) Dockerfile
I emphasize that I am using GitVersion.MsBuild pinned in version 5.6.4 due to a bug in the version 5.6.5 and above.
vadym commentedon Mar 18, 2021
@Lukkian - Thank you for your proposal (to use debian). But I'd like to have solution without this vulnerability: https://security-tracker.debian.org/tracker/CVE-2019-25013.
asbjornu commentedon Mar 8, 2022
I think this is resolved and can be closed. Please object if you disagree.