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.
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.
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.
Pun Intended. :D
So, Bye-bye Works on my machine issues.
- Windows 10 Professional or Enterprise version 1809 (2019 LTSC) or later. For enabling process isolation, version 1909 is recommended.
- Hyper-V has to be enabled. More info on that here.
Windows 10 Home does support Docker but does not support Windows Containers.
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.
- Clone the Sitecore Docker Examples repository from here. This is the best and easiest way to play around with Sitecore Docker.
- Launch Powershell as Administrator.
Run iisreset /stop to stop the IIS server. This is quite an important step.
- Change Directory to the
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.
Now, run docker-compose pull. This will pull all the images specified in the docker-compose.yml file.
Run docker-compose up -d (or docker-compose up —detach). This builds, (re)creates, starts, and attaches to containers for a service.
Run docker ps to list the containers created.
- Your installation is now complete.
With the default parameters, the below URLs can be used to access the Sitecore containers.
- Sitecore Content Management (cm):https://xp0cm.localhost
- Sitecore Identity Server (id):https://xp0id.localhost
- Sitecore xConnect Server (xconnect):http://localhost:8081
- Apache Solr (solr):http://localhost:8984
- Microsoft SQL Server (mssql): localhost,14330
The default admin login credentials will be:
Feel free to use the comments section to start a discussion on Sitecore containers.