libgit2 / libgit2/libgit2sharp

Docker Alpine container exit code 139

未關閉
#1,807 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
C#
星號
3.5k
分支
925
PR 合併指標
30 天內沒有已合併 PR

描述

Reproduction steps

I'm running this Dockerfile with a project that uses libgit2sharp.

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine as base

EXPOSE 80

VOLUME /etc/nginx
VOLUME /etc/ssl
VOLUME /myproject

ADD tools/ssl/myproject* /etc/ssl/

# Install git.
RUN apk update && apk upgrade && \
    apk add --no-cache git openssh nano

# Build WebSite.
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine AS build

# Install nodejs.
RUN apk update && apk upgrade && \
    apk add --no-cache npm

# Copy everything and publish app
WORKDIR /src
COPY ./src/. .
WORKDIR /src/MyProject/WebSite
RUN dotnet publish -c release -o /app

# Final stage/image
FROM base as final

WORKDIR /app
COPY --from=build /app ./
ENTRYPOINT ["dotnet", "MyProject.WebSite.dll"]

Expected behavior

No crash.

Actual behavior

Docker container exits with code 139. There is nothing being logged from .NET. try/catch is not handling anything. There is no information in docker info. There are no logs in docker itself. I have absolutely no idea why this is crashing.

I'm using this Dockerfile for debugging in Visual Studio.

# This dockerfile is used for debugging in Visual Studio.
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine

EXPOSE 80
VOLUME /etc/nginx
VOLUME /etc/ssl
VOLUME /myproject

RUN apk update && \
	apk add --no-cache nodejs npm git openssh

ADD keys/. /root/.ssh/

RUN chmod 600 /root/.ssh/*

Everything works fine here. It's running in the same container OS. The only difference is everything is built inside the container for the image, whereas debugging everything is built then copied in.

I don't know how to figure out what's going wrong at this point.

Version of LibGit2Sharp (release number or SHA1)

0.27.0.-preview-0034

Operating system(s) tested; .NET runtime tested

Docker container mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先,使用 issue 中所示的多階段 Dockerfile 和 Visual Studio 偵錯 Dockerfile 重現該故障,並比較它們的 build 和 copy 步驟。檢查進入點 dotnet MyProject.WebSite.dll 以及容器的 exit-139 行為;完成的標準是找出 native crash 的原因,並記錄已確認的 fix 或 workaround。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
csharp, docker
領域
devops
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。