Over the course of several months I have had the opportunity to introduce the use of docker within development teams as an alternative approach for developing with Sitecore. Developing with Sitecore on Docker requires a bit of a mind shift from your normal way of working with Sitecore. But if offers many benefits like the ability to stand up a fully scaled instance of Sitecore in seconds rather than hours. This blog provides a introduction to docker and getting started developing with Sitecore on Docker.
What is Docker
Docker is a platform that enables you to develop, ship, and run applications as containers. The Docker Daemon process (or engine) runs on your host OS which manages images and containers.
The Command Line Interface (CLI) communicates with the docker daemon via rest API.
Containers vs VMs
Containers are an abstraction at the app layer that packages code and dependencies together. Multiple containers can run on the same machine and share the OS kernel with other containers, each running as isolated processes.
- take up less space.
- more portable and efficient.
- require fewer VMs and Operating systems.
- reduce cost as fewer licenses are required.
- start in seconds.
- are ephemeral – treated like cattle in your DevOps service model.
VMs are an abstraction of physical hardware turning one server into many servers. The hypervisor allows multiple VMs to run on a single machine.
- includes a full copy of an operating system, the application, necessary binaries and libraries – are much larger in size.
- VMs can also be slow to boot.
- start in minutes
- tend to hang around longer – treated more like pets in your DevOps service model.
By combining Containers and VMs in your infrastructure provide a great deal of flexibility in deploying and managing your application.
Sitecore Docker Repo
The Sitecore Docker Repo contains docker files for a plethora of Sitecore versions and their variants including: JSS, SXA, SPE. Also necessary scripts, tools and supporting documentation to help you build Sitecore Docker images and ultimately run a containerized instance of Sitecore.
Lets backup for those of you that may not be familiar with some of these terms:
- Dockerfile – is a text document that contains all the commands you would normally execute manually in order to build a Docker image.
Docker can build images automatically by reading the instructions from a Dockerfile.
- Docker Images – are the basis of containers. An Image is an ordered collection of root filesystem changes and the corresponding execution parameters for use within a container runtime. An image typically contains a union of layered filesystems stacked on top of each other. An image does not have state and it never changes.
- Docker Container– is a runtime instance of a docker image.
Thanks to the hardwork and dedication to the individuals in our community that contribute to the Sitecore Docker repo. Which is continually evolving.