-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Missing Git Information with Docker build #216
Comments
It's not about a |
I don't mean to bump but i'm having the exact same issue and installing git in the container didn't work. my dockerfile looks like this: FROM mcr.microsoft.com/dotnet/runtime:7.0 AS base
WORKDIR /app
RUN apt-get -y update
RUN apt-get -y install git
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["XaiSharp/XaiSharp.csproj", "XaiSharp/"]
RUN dotnet restore "XaiSharp/XaiSharp.csproj"
ADD . .
COPY . .
WORKDIR "/src/XaiSharp"
RUN dotnet build "XaiSharp.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "XaiSharp.csproj" -c Release -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "XaiSharp.dll"]
|
Before the build, run (for example) |
Two troubleshooting tips in case anyone else is having this problem:
|
Missing Git Information with Docker build
Steps to Reproduce
My application is packaged into a docker image.
In the docker file I'm building the application with dotnet build and dotnet publish, but the Git information is not being generated.
The extract of my docker file looks a bit like the below example
I'm not sure how the package works, but I'm guessing it needs the ".git" folder or something like that to work and pull the information.
Did anybody faced a similar situation, and resolved it.
Do you have any example or best practice to make this work as part of the DockerFile.
Expected Behavior
The Dll should have the "TheAssembly.Git" class with the correct Git information.
Actual Behaviour
If I look at the compiled code, I can see that the Git class doesn't have any of the Git information.
It probably makes sense because there wouldn't be any ".git" folder to use.
The text was updated successfully, but these errors were encountered: