Fix Sitecore 10 Docker installation

Created: 30 Aug 2020, last update: 12 Sep 2020

Fix Sitecore 10 Docker installation

I had a company laptop with a fresh company image with a relatively high amount of company policy settings available. A good time to see if there are any issues to run the Sitecore 10 Docker images. Except for some small things it went very well. In this blog my findings and solution, if you have experienced the same and googled for the solution? Hopefully this helps.

When running init.ps1 for populating required .env file variables.

An error occurred while attempting to generate TLS certificates: Using the local CA at "C:\Users\username\AppData\Local\mkcert" ✨
Solution, only this part is failed, do it manually, not in PowerShell but in a MS-DOS, Windows Command Prompt. Go to the \traefik\certs directly. In my case mkcert.exe was already put there, run:
mkcert -install
mkcert -cert-file xp0cm.localhost.crt -key-file xp0cm.localhost.key "xp0cm.localhost"
mkcert -cert-file xp0id.localhost.crt -key-file xp0id.localhost.key "xp0id.localhost"

(If you are doing the xp0 installation, else change the host names) And everything is fine, you ready to run. ”docker-compose.exe up –detach” in the sitecore-xp0 directory,

There is also a variant of the init script with a

catch {
Write-Error "An error occurred while attempting to generate TLS certificate: $_" -ForegroundColor Red

}

This cause the following error when you have a mkcert exception:

Downloading and installing mkcert certificate tool...
Generating Traefik TLS certificate...
C:\Projects\MVP-Site\init.ps1 : A parameter cannot be found that matches parameter name 'ForegroundColor'.
+ CategoryInfo : InvalidArgument: (:) [init.ps1], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,init.ps1

Solution change to:

catch {
Write-Error "An error occurred while attempting to generate TLS certificate: $_" -ForegroundColor Red

}

But you still have than an error, run the mkcert manual.

ERROR: a Windows version 10.0.18363-based image is incompatible with a 10.0.17763 host

Running on an old Windows 10 version, and auto updates disabled, Your organization has turned off automatic updates. Try the ltsc2019 version which uses older windows.

I forgot to turn-off my IIS.
And run into a:
failed during hnsCallRawResponse: hnsCall failed in Win32: The process cannot access the file because it is being used by another process. (0x20)
It usually means port is in use, turn off IIS or other service using the same netwerk port. port 443, 8079, 8081, 8984, and 14330 are needed for Sitecore 10 Docker. You can found this and many other troubleshooting on https://containers.doc.sitecore.com/docs/troubleshooting

 

Invoke-WebRequest : The remote name could not be resolved: 'dist.nuget.org'
At line:1 char:76
+ ... yContinue'; Invoke-WebRequest https://dist.nuget.org/win-x86-commandl ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:Htt
pWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShe
ll.Commands.InvokeWebRequestCommand

There are a some solution you can try for this: see sitecore.stackexchange For me the answere from Pankaj Tiwari works

  1. Downloaded nuget.exe, manually using this https://dist.nuget.org/win-x86-commandline/v5.6.0/nuget.exe
  2. Create an empty folder as "Nuget" under "C:\Program Files". -- C:\Program Files\Nuget
  3. Copy the nuget.exe to C:\Program Files\Nuget\
  4. Comment this line in Dockerfile, available in ROOT_PROJECT\docker\build\dotnetsdk\Dockerfile
  5. ## RUN Invoke-WebRequest "https://dist.nuget.org/win-x86-commandline/v5.6.0/nuget.exe" -UseBasicParsing -OutFile "$env:ProgramFiles\NuGet\nuget.exe"
  6. Afterwards run .\up.ps1 again


There is a lot of documentation from Sitecore to install, are you lost in the steps. Take a look at:
Step-by-step install Sitecore XP 10 to developer workstation using Sitecore Containers with Docker Compose
 or here