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 cmd scr.sitecore.com/sxp/sitecore-xp0-solr-init:10.1-ltsc2019
The “magic” part here is -it –entrypoint cmd, where we tell docker that the entrypoint of this container should run cmd, as entrypoint 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.