[Bug]Segmentation Fault on docker alpine 3.13
See original GitHub issueDescribe the bug I rely on GitVersion.MSBuild on all my .net core projects. When creating docker images of these project all the versioning was working fine up until I needed to create more compact docker images. When converting my docker files to build an image based on alpine the projected failed to compile with a Segmentation Fault. Initially I thought it was an issue with the build task, but when I was creating a reproducible sample I found that the problem wasn’t related to the build task, but gitversion tools also has the problem.
Expected Behavior
running dotnet-gitversion should return version information
Actual Behavior
returns Segmentation Fault
Steps to Reproduce
From within a git repository. Create a Dockerfile ` ARG VERSION=5.0-alpine
#FROM mcr.microsoft.com/dotnet/aspnet:$VERSION AS base FROM mcr.microsoft.com/dotnet/runtime-deps:$VERSION AS base WORKDIR /app
FROM mcr.microsoft.com/dotnet/sdk:$VERSION AS sdkwithgitversion RUN dotnet tool install -g GitVersion.Tool ENV PATH=“$PATH:/root/.dotnet/tools”
FROM sdkwithgitversion AS build WORKDIR /src COPY . . ` run the docker file and bash into it. Then run dotnet-gitversion to see the error.
Alternatively I have created a reproducable repo here https://github.com/PedroCigaw/gitversionalpinebug
- clone repo above
- run: docker build -t alpinebug -f .\Dockerfile.alpine.base .
- run: docker run -it alpinebug /bin/ash
- type: dotnet-gitversion
Context
Our docker images have to be built on alpine from a security and size perspective, this has meant I been forced exclude the GitVersion.MSBuild references when building the docker images, which in turn means no versioning. I’m hoping there is a simple solution in the offing before going to the time and expense of rethinking how I can manage versions consistently between docker builds, CI Builds and nuget packages
- Version Used: GitVersion 5.6.8
- Operating System and version (Windows 10, Ubuntu 18.04): Window 10
- Link to your project: https://github.com/PedroCigaw/gitversionalpinebug
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Upon further investigation I found this works if I specifically target the version to “5.0-alpine3.12” of the dotnet docker images.
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs.