Avoiding Base64 License Conversion

Leveraging containerization with Sitecore is opening up new opportunities for organization, development teams, and those of us that in enjoy a bit of tinkering with our favorite platform. As I further delve into this new way of doing things, I understand more and more why people had been working as a community to get Sitecore to run this way, my sincere appreciation to all those who spent time buildign the community images for Sitecore 9.

As I have started to move my own development flow into containers, I became concern right away with the idea of having to Base64 encode my Sitecore license file which is then fed into my image during docker-compose. As I work for a Sitecore partner, I get a new license file yearly, which would quickly become a headache for myself and teams trying to adujst all of our docker-composes to use a new encoded string representation.

While reviewing the XP 10.0.1 Developer Workstation Installation guide I came across the following interesting tidbit regarding being able to leverage a file-based experience for the license file, highlighting is mine:

This echoed some conversation I saw along the way in the Sitecore Slack channel as well as some additional steps in the Community Image repository. You may notice that there is a call out in the above instructions note, to see an example in the Sitecore Container Development documentation., after a deep dive through all the links I could not find this explanation. We a little investigation in the older docker-compose files in the Community Image repository, the following are the required steps to simplify your license management for Sitecore containers.

The following shows the required changes tied to the SXP Sitecore Container Deployment 10.0.1.004842.266 release. This download provides the barebones docker-compose file for the most basic topologies. These should always be used as a starting point for the creation of you own custom images. I’ll specifically call out the changes required for a XP-01 topology, which should include all the major server types that you need to be worried about.

Changes to the docker-compose, or related overrides file, be required to be made to any Sitecore related server, which you can see majority of the servers started up:

The first step in this process is to open the .env file and add a new variable to represent the path to the directory of your Sitecore license file. The license file should be the only file in this directory, as we will be setting it up as a mount, so anyother files will be accessible by the container.

This new variable will be named: SITECORE_LICENSE_FOLDER. You could reuse the existing license variable, but I prefer the cleanness of making it easily distinguished.

Depending on the service different values must be inputted into the docker-compose or related override YAML file. The quick summary is:

Changes for ID, CD, CM, Prc, Rep

  1. Under environment rename ‘Sitecore_License’ to Sitecore_License_Location
  2. Sets the value of this new argument to C:\license\license.xml
  1. Add a new volume mount to the service tying the Sitecore folder from the environments list to C:\license on the image.
volumes:
    - ${SITECORE_LICENSE_FOLDER}:C:\license

Changes for everything else…

( xdbcolllection, xdbsearch, xdbautomation, xdbautomationrpt, cortexprocessing, cortexreporting, xdbrefdata, xdbsearchworker, xdbautomationworker, cortexprocessingworker )

  1. Under environment rename ‘Sitecore_License’ to Sitecore_License_Location
  2. Sets the value of this new argument to C:\license, note how this does NOT include the actual filename.
environment:
    Sitecore_License_Location: C:\license
  1. Add a new volume mount to the service tying the Sitecore folder from the environments list to C:\license on the image.
volumes:
    - ${SITECORE_LICENSE_FOLDER}:C:\license

The full example of the docker-compose and .env see the gists

https://gist.github.com/gillissm/b6974def38b0f25a33447e35d4dde7e0.js

One thought on “Avoiding Base64 License Conversion

  1. Pingback: Sitecore XP .5 Container Topology | The Code Attic

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.