Sitecore Management Services 3.0.0 module installation in Sitecore 10.1 Docker Instance

Extending on my previous blog of serializing content items in a Sitecore 10.1 instance , I wanted to try the same process but this time on a Sitecore 10.1 instance running on Docker. 

In order to accomplish the same, you need to have the Sitecore Management Services module pre-installed while creating the Sitecore 10.1 instance. This can be accomplished by making changes to the Docker Base Sitecore image -  a process named as overriding in Sitecore Docker terms. For more details, check Add Sitecore Modules tutorial.

Here is the Sitecore Docker github repo I used for reference.

So, here are the changes I had to make in order to pre-install Sitecore CLI 3.0.0 or the latest Sitecore Management Services module -

Here is a high-level diagram about the data flow relationship among the .env file, docker compose (override) file and individual docker files:


With relation to current context, a docker compose file defines what containers must be created and for each container states the related image file that should be used.

Then, you can also define a docker compose override file that has additional parameters helpful in customizing the base docker compose file. The override file in turn delegates functionality to individual docker files.

Each of the docker files defines the specific image to pull from the Sitecore Docker repository and define what to do with the specific image.

In our case, bottom-up in the above list,

1. Here are the changes done to the dockerfile under build\cm:

2. Here are the changes to the docker compose override file (in the base folder alongside the base docker compose file):


3. Understandably, No changes to the base docker compose file are needed since this is taken care by the override file.

4. Next, let's get started with the usual rituals, in the init.ps1 file, provide the desired host name:

5. Now, in the .env file, ensure the relevant project name, registry and version are filled -


6. Also, in the .env file, ensure to add the correct tag for Sitecore Management Service from here - https://raw.githubusercontent.com/Sitecore/docker-images/master/tags/sitecore-tags.md


7. .Env file with the SMS tag name:


8. Next execute init.ps1 -



9. Filled .env file:


10. Time to docker-compose up -d:


11. Browse the cm instance:


There is some proof that this definitely is a Docker-based instance!

12. Next, to check if serialization works fine, let's create a local folder and set it up as per https://navansitecorenotes.blogspot.com/2021/03/create-item-package-using-sitecore-cli.html

13. Once the folder is setup, its time to connect to the Docker Sitecore  instance and then authorize, 


14. Now, let's install the same cssclassoptionspackage.itempackage used in the previous blog to this Docker instance:


15. Finally, In the Sitecore Content tree you can see the end-result:


Now, we have Sitecore CLI 3.0.0 running against a Sitecore 10.1 Docker Instance!

Docker Compose Override file in the base custom images folder

Docker File in custom images cm folder

Comments

Popular Posts