-
-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working in .NET Core docker image #252
Comments
Hi @labsilva, thanks for reaching out. I think the discussion in #228 may be very relevant to this. In short, the problem is that there are many Linux distros that may or may not include the native dependencies that libgit2 requires. In particular, the crypto libraries used for SSL, since libgit2 supports fetch/push. NB.GV has no need of this fetch/push functionality, but the fact NB.GV uses libgit2sharp, which uses libgit2, which uses libssl, means that you have to have the right libssl package installed on your Linux container for it to work. There is ongoing work in the libgit2(sharp) community to finally tease apart this libssl dependency to make this much easier. And in the shorter term other workarounds are available or in progress. For now, what I do when I'm working with docker images where it fails is install these two packages: You could install these as part of your CI build (they install relatively quickly) or you could adjust your docker image to include them yourself, as I do above. But ya, we plan to adopt any fixes to libgit2sharp soon after they're available to make this "just work" on an increasing number of Linux distros and docker images. |
Just a thought, but have you considered ditching lib2git and just calling git from command line? |
Yes, I have. I haven't looked into it deeply, because my first take suggests it would be incredibly slow. We have to look for version.json files in the tree for each commit in history till we find certain significant changes. That would mean a lot of git.exe invocations. libgit2sharp is much faster than git.exe. Since this runs in people's builds, and can run many times in a build because it may run once for each project, perf is a very high priority. |
Hi @AArnott, thanks for the quick reply! I've tried adding the packages you said (libcurl3 and libssl1.0.0), but while using the .NET SDK Debian based image (the latest one) I can't locate those packages. From what I could gather it seems they don't support it anymore and have transitioned to a newer version. This newer version doesn't work with libgit2 (or at least I wasn't able to get it to work). I did manage to get it to work with .NET SDK Ubuntu (Bionic) based image, but that's not really an option for me at the moment. Are there any other workarounds I can try for now, or should I just wait for a newer version? Again, thanks for replying! |
I know that once certain packages are installed, the workaround (oddly) quits working. As another workaround, try using an older version of NB.GV. The 2.1.x releases work on some distros that 2.2 doesn't. |
I've tried with almost all releases from 2.1.x and I couldn't get it to work. I'll wait for a new version from libgit2. As for why I must use Debian... it's not a case of must, more a case of not wanting to change right now; I have a reasonable number of applications running in my CI pipeline generating images and this change from Debian to Ubuntu would have to be properly validated, and right now it wouldn't be a good time. I'll close this one (if it's OK with you), and will try again when you release a new version 😄 |
Bumps [dotnet-coverage](https://github.com/microsoft/codecoverage) from 17.10.2 to 17.10.3. - [Commits](https://github.com/microsoft/codecoverage/commits) --- updated-dependencies: - dependency-name: dotnet-coverage dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Hello!
Just added NerdBank.GitVersioning to a .NET Core solution, and I'm receiving some errors.
The solution is build with GitLab CI on a Docker container running the image
microsoft/dotnet:2.1-sdk
.The error I'm getting when building:
After digging around for a couple of hours, I tried to create a new console project inside the container and then adding NerdBank.GitVersioning:
Running in Docker
docker run --rm -it microsoft/dotnet:2.1-sdk bash
And then I got the following error:
I've googled a bit and found some issues similar to mine, but the workarounds or solutions provided didn't work.
Am I doing anything wrong? Can someone point in the right direction?
The text was updated successfully, but these errors were encountered: