Build the docker image failed
See original GitHub issueI have got this error when I tried to build the image on Windows.
Step 8/14 : RUN dotnet build src/BaGet -c Release -o /app
---> Running in 5ba65c918ade
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 48.98 ms for /src/src/BaGet.Core/BaGet.Core.csproj.
Restore completed in 48.98 ms for /src/src/BaGet.Azure/BaGet.Azure.csproj.
Restore completed in 25.99 ms for /src/src/BaGet/BaGet.csproj.
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: The "Nerdbank.GitVersioning.Tasks.GetBuildVersion" task failed unexpectedly. [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: Unable to load shared library '/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/lib/linux/x86_64/libgit2-6311e88.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libssl.so.1.0.0: cannot open shared object file: No such file or directory [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at System.Runtime.Loader.AssemblyLoadContext.InternalLoadUnmanagedDllFromPath(String unmanagedDllPath) [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at System.Runtime.Loader.AssemblyLoadContext.LoadUnmanagedDllFromPath(String unmanagedDllPath) [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at MSBuildExtensionTask.ContextAwareTask.CustomAssemblyLoader.LoadUnmanagedDll(String unmanagedDllName) [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at System.Runtime.Loader.AssemblyLoadContext.ResolveUnmanagedDll(String unmanagedDllName, IntPtr gchManagedAssemblyLoadContext) [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at LibGit2Sharp.Core.NativeMethods.git_libgit2_init() [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at LibGit2Sharp.Core.NativeMethods.LoadNativeLibrary() [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at LibGit2Sharp.Core.NativeMethods..cctor() [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: --- End of inner exception stack trace --- [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at LibGit2Sharp.Core.NativeMethods.git_libgit2_opts(Int32 option, UInt32 level, String path) [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at LibGit2Sharp.GlobalSettings.SetConfigSearchPaths(ConfigurationLevel level, String[] paths) [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at Nerdbank.GitVersioning.GitExtensions.OpenGitRepo(String pathUnderGitRepo) [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at Nerdbank.GitVersioning.VersionOracle.Create(String projectDirectory, String gitRepoDirectory, ICloudBuild cloudBuild, Nullable`1 overrideBuildNumberOffset, String projectPathRelativeToGitRepoRoot) [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at Nerdbank.GitVersioning.Tasks.GetBuildVersion.ExecuteInner() [/src/src/BaGet.Core/BaGet.Core.csproj]
Build FAILED.
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: The "Nerdbank.GitVersioning.Tasks.GetBuildVersion" task failed unexpectedly. [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: Unable to load shared library '/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/lib/linux/x86_64/libgit2-6311e88.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libssl.so.1.0.0: cannot open shared object file: No such file or directory [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at System.Runtime.Loader.AssemblyLoadContext.InternalLoadUnmanagedDllFromPath(String unmanagedDllPath) [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at System.Runtime.Loader.AssemblyLoadContext.LoadUnmanagedDllFromPath(String unmanagedDllPath) [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at MSBuildExtensionTask.ContextAwareTask.CustomAssemblyLoader.LoadUnmanagedDll(String unmanagedDllName) [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at System.Runtime.Loader.AssemblyLoadContext.ResolveUnmanagedDll(String unmanagedDllName, IntPtr gchManagedAssemblyLoadContext) [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at LibGit2Sharp.Core.NativeMethods.git_libgit2_init() [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at LibGit2Sharp.Core.NativeMethods.LoadNativeLibrary() [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at LibGit2Sharp.Core.NativeMethods..cctor() [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: --- End of inner exception stack trace --- [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at LibGit2Sharp.Core.NativeMethods.git_libgit2_opts(Int32 option, UInt32 level, String path) [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at LibGit2Sharp.GlobalSettings.SetConfigSearchPaths(ConfigurationLevel level, String[] paths) [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at Nerdbank.GitVersioning.GitExtensions.OpenGitRepo(String pathUnderGitRepo) [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at Nerdbank.GitVersioning.VersionOracle.Create(String projectDirectory, String gitRepoDirectory, ICloudBuild cloudBuild, Nullable`1 overrideBuildNumberOffset, String projectPathRelativeToGitRepoRoot) [/src/src/BaGet.Core/BaGet.Core.csproj]
/root/.nuget/packages/nerdbank.gitversioning/2.2.13/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: at Nerdbank.GitVersioning.Tasks.GetBuildVersion.ExecuteInner() [/src/src/BaGet.Core/BaGet.Core.csproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:02.16
The command '/bin/sh -c dotnet build src/BaGet -c Release -o /app' returned a non-zero code: 1
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to debug build failures - DockerEngine
In short, look at the container ID of the failed step, then commit that to a temporary image, then run 'sh' (or 'env'...
Read more >How can I inspect the file system of a failed `docker build`?
Everytime docker successfully executes a RUN command from a Dockerfile, a new layer in the image filesystem is committed.
Read more >How to solve the error 'Failed to build the docker image ...
This error message typically indicates that there was an issue building the Docker image for your project. To troubleshoot the problem, you can...
Read more >Docker image build failed - GitLab CI/CD
CI says that it cannot find the jar file during docker build. But the jar file is there when I do an ls...
Read more >Failed to build docker image with the Dockerfile · Issue #5499
Tried to build a docker image with the command : docker image build -t aws-cdk:1.0 . But failed with the following error.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, it is working now. Thanks 😃
Did updating your project fix the issue?