0

I have cloned Sitecore docker-examples repository and started to go through tutorial of building custom images Building Custom Sitecore images.

I noticed that when I use the command docker-compose build solution, it throws and error about not finding a certain nuget package: Error on console

I did opened the example solution on VS2019 and published the project to directory and it works, so does build solution. I checked that the package is indeed in nuget.org, so how come it cannot find it? However, its not installed to these projects in solution and Package Manager does not allow me to do that, its only referenced in Directory.Build.targets. Why I'am getting this error?

Error is: The SDK 'Microsoft.Buikd.CentralPackageVersions/2.0.79' specified could not be found.

1

2 Answers 2

1

Unable to load the service index for source would seem to be the key error here. It likely indicates that your container is unable to access the internet, or your network has proxy requirements which you need to add to your NuGet.config.

One other potential solution is fixing the interface metric of your network adapter:

You can fix this by setting your primary internet-connected networking adapter to have the lowest InterfaceMetric value:

CopyGet-NetIPInterface -AddressFamily IPv4 | Sort-Object -Property InterfaceMetric -Descending`

Use this command to make the change (this example assumes primary adapter InterfaceAlias is 'Wi-Fi'):

CopySet-NetIPInterface -InterfaceAlias 'Wi-Fi' -InterfaceMetric 3

If your host's primary network adapter is bridged because you have an External virtual switch setup in Hyper-V, set the external virtual switch to have the lowest InterfaceMetric value.

You may wish to try running the Sitecore Container Prerequisites troubleshooting tool.

1
  • Thank you Nick. That was the issue for mine. After running those scripts the error went away.
    – Mhoque
    Nov 11, 2021 at 17:39
-2

I managed to fix this error by installing .NET 5.0.4 and restarting PC. I checked the folder after command 'docker-compose build solution' does "Microsoft.Buikd.CentralPackageVersions" folder appear inside "dotnet/sdks/5.0.4" folder but it does not. But still this fixed the error. Strange that console shows many different errors but this was the one that fixed all of them.

2
  • What you have installed on your host PC has absolutely no bearing on your docker-compose build process. Other than Docker Desktop itself, obviously. Oct 4, 2021 at 0:42
  • Well I do understand with docker it shouldn't, but I have no other explanation why it started to work. Dec 7, 2021 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.