Sitecore- Inspecting the (init) containers

With Sitecore making the shift to containers, the concept of init containers has also popped up. At this time of writing, there are currently two init containers; one for MSSQL and one for SOLR.

A big mystery is what those containers do, as unfortunatetly the dockerfiles of the Sitecore containers are not publicilly accessible. The container shuts down as soon as it’s done, so there’s no time to properly inspect the contents of the container.

There’s an easy way to overwrite the entrypoint of the container, meaning that it won’t do what it is told to do, but it gives you the chance to run your own command on start up. For example, if you would like to inspect the solr-init container, just run the following docker command:

docker run -it --entrypoint powershell

The “magic” part here is -it –entrypoint powershell, where we tell docker that the entrypoint of this container should be powershell, and that we want to execute it interactive mode. This command opens a powershell window in the container, which gives you the ability to do whatever you want in the container. If you want to inspect another container, just change the last part where you specify the image.

Leave a Reply

Your email address will not be published. Required fields are marked *