All Articles

Install and setup Sitecore XP 10 with Docker

Introduction

What are containers?

Containers are an executable unit of software in which code is packaged, along with its libraries and dependencies, in common ways so that it can be run anywhere - whether it be on a developers’ workstation, on-prem servers, or the cloud - and deployed easily and consistently, regardless of the target environment.

Containerization of an application provides a clean separation of concerns, as developers focus on their application logic and dependencies, while IT operations teams can focus on deployment and management.

Some of the key benefits of containerization:

  • Lightweight- Small size on disk and very low overhead.
  • Isolation- Containers keep apps isolated not only from each other, but from the underlying system. Inherent constraints mean containers are secure by default.
  • Portability- A container runs on any machine that supports the container’s runtime environment. You can build locally, then easily move to on-premise or cloud environments.
  • Loose coupling- Containers are highly self-sufficient and encapsulated, allowing you to replace or upgrade one without disrupting others.
  • Scalability- Because containers are lightweight with loose coupling, you can scale out quickly by creating new containers.

What is Docker?

Containers first appeared decades ago, but modern container development really took off with the introduction of Docker in 2013.

Docker is both an open-source project for building applications on containers, and also a company that promotes and evolves the technology. They also own Docker Hub, which is Docker’s official registry. Docker has become synonymous with containers because it has been the most successful at popularizing it. Originally built for Linux, Docker now runs on Windows and macOS as well.

More documentation about Docker and Containers can be found here.

Why Sitecore with Docker?

Containers and Docker are the new buzzes in the market. We may as well see a lot of opportunities to completely shift towards containers as a whole. Sitecore introducing container-based development officially is an indication that the various examples such as Habitat, Lighthouse, and Helix Examples, etc. will all be now entirely over Docker.

The philosophy behind Docker is quite simple actually.

docker-meme

Pun Intended. :D

So, Bye-bye Works on my machine issues.

Prerequisites

  1. Windows 10 Professional or Enterprise version 1809 (2019 LTSC) or later. For enabling process isolation, version 1909 is recommended.
  2. Hyper-V has to be enabled. More info on that here.

Windows 10 Home does support Docker but does not support Windows Containers.

Docker Desktop

Download and Install Docker Desktop from here.

You can use Chocolatey if you are a CLI person.

choco install docker-desktop

During installation, choose to use Windows containers instead of Linux containers. You can also switch to Windows containers after the install.

switch-to-windows-containers

Steps for Installation

  1. Clone the Sitecore Docker Examples repository from here. This is the best and easiest way to play around with Sitecore Docker.
  2. Launch Powershell as Administrator.
  3. Run iisreset /stop to stop the IIS server. This is quite an important step.

    iisreset-stop-powershell

  4. Change Directory to the /docker-examples/getting-started.
  5. Run init.ps1 with below the parameters, save your license somewhere and use the same path for LicenseXmlPath.

    cd C:\sitecore\docker-examples\getting-started
    .\init.ps1 -LicenseXmlPath C:\License\license.xml

    The init.ps1 will install SitecoreDockerTools and populate your .env file with the appropriate values. It also adds the hosts entries and SSL certificates.

  6. Now, run docker-compose pull. This will pull all the images specified in the docker-compose.yml file.

    sitecore-docker-compose-pull

  7. Run docker-compose up -d (or docker-compose up —detach). This builds, (re)creates, starts, and attaches to containers for a service.

    sitecore-docker-docker-compose-up

  8. Run docker ps to list the containers created.

    sitecore-docker-ps

  9. Your installation is now complete.

Access the Sitecore Containers

With the default parameters, the below URLs can be used to access the Sitecore containers.

The default admin login credentials will be:

Username: admin

Password: Password12345

sitecore-10-login-screen

Happy Sitecoring!

Feel free to use the comments section to start a discussion on Sitecore containers.