question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]Segmentation Fault on docker alpine 3.13

See original GitHub issue

Describe 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

  1. clone repo above
  2. run: docker build -t alpinebug -f .\Dockerfile.alpine.base .
  3. run: docker run -it alpinebug /bin/ash
  4. 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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
PedroCigawcommented, Apr 13, 2021

Upon further investigation I found this works if I specifically target the version to “5.0-alpine3.12” of the dotnet docker images.

0reactions
github-actions[bot]commented, Apr 7, 2023

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Segfault on Alpine Linux 3.13 / musl 1.2.2 with prebuilt ...
On the alpine:3.13 Docker image, install Sharp and attempt to load an image and run .metadata() on it. Node exits with a segmentation...
Read more >
Docker Alpine - GraphViz - gvpr causes Segmentation fault ...
The segfault seems to be a bug in the gvpr program. This bug seems to be fixed on the latest gvpr version from...
Read more >
Docker build with Alpine Linux causes segmentation fault ...
I cannot build the given Dockerfile due to an error when invoking the bundle_install command: DESKTOP-SI79RLD:~/test$ cat Dockerfile FROM ruby:2.5-alpine ...
Read more >
Docker alpine:3 Segmentation Fault
Hi, I have strange problem. I've started write simple app. It runs on debian every time, also in docker containter with debian, ...
Read more >
Varnish 4.1 segfault (#4938) · Issues · alpine / aports · GitLab
I'm trying to use Varnish 4.1 with Docker (1.9.1). I've built a docker image in Alpine Linux 3.2 with its musl-libc to reduce...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found