Sitecore 10 and Docker - Learnings
Published: 2020-08-29 15:56:27

I was excited to hear about Sitecore's version 10 release a couple of weeks ago mostly due to it's Docker support. During my exploration of both Docker and Sitecore 10 I discovered some gotchas and stumbling blocks which I catalog below.

To setup an initial clean installation I used this excellent guide:

https://containers.doc.sitecore.com/docs/intro

I'm not going to step through the entire process as the documentation is already excellent and there are already blog posts doing exactly that. Instead I am going to call out the problems I ran into during the process. 

## The TLS Problem

The first issue I ran into was a problem with the TLS version during this step:

https://containers.doc.sitecore.com/docs/run-sitecore#preparation

The work around with this was to run the following in the powershell session:

```powershell
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
```

## The Proxy Problem

Ah the proxy, a constant source of pain and suffering. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/qsvicostmwgc1yrhsdwj.JPG)

This turned out to be proxy settings. I was able to address the problem by adding proxy configuration to my Powershell profile.ps1. Note: I also added the TLS configuration to ensure it's in place for each session and some debug information written to the console.

```powershell
[system.net.webrequest]::defaultwebproxy = new-object system.net.webproxy('proxy address')

[system.net.webrequest]::defaultwebproxy.credentials = New-object System.Net.NetworkCredential('login','password')
[system.net.webrequest]::defaultwebproxy.BypassProxyOnLocal = $true

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12


Write-Output "Proxy set to proxy credentials with bypass on local true"
netsh winhttp show proxy

Write-Output "Set protocol default to Tls12"
```

*Tip: Running this command will reload the profile for the current powershell session.*


```powershell
 & $profile
```


## Windows 10 Build Woes 

I was able to complete all of the subsequent steps except, when I attempted to run the last docker compose command, I received the following error:

```powershell
ERROR: a Windows version 10.0.17763-based image is incompatible with a 10.0.17134 host
```

I had noted I wasn't running the required Windows 10 build most likely due to group policy within my organization. I had hoped I could get away with it, sadly this was not to be the case. To work around this I manually installed the May 2020 Update using this link:

https://www.microsoft.com/en-us/software-download/windows10

## Reverse Proxy Contention

After clearing these hurdles all the docker images started and appeared healthy except for the traefik reverse proxy. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/9vv5jkwj086ktd7z1l49.JPG)

The error in the console suggested some file contention so I shut down any IIS sites on the same machine and tried starting the image again.

**Success!**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/6la6iyglka7aauqewxi3.JPG)


*Tip: docker ps is useful for checking on the status of the docker images as well as some other information.*

```powershell
docker ps
```

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/x616hferrv1m2z7aztoj.JPG)

## The Bottom Line

The end result is a Sitecore 10 CD and CM running locally. This is by far the simplest and least time consuming plain vanilla Sitecore deployment I've experienced. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/9txly5yn7fwx20r3o55g.JPG)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ac01uteopb6cq427fo8q.JPG)

<hr>

## Next Up

*Preparing our Visual Studio Solution for deployment in Docker*

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/chaj1hnoouthqsl21u0l.gif)