Insights

Debugging Containers In Sitecore Docker

Sitecore Docker Pro Tips Series

Tips On Debugging Containers

You can attach a shell to a container to diagnose folder structures and files deployed.

      docker container exec -it <container-name/id> powershell

    

You can also use this within the context of the docker compose to analyze failed containers ,i.e. to check network connectivity to the database service (mssql) using ping or telnet.

Screenshot of debugging containers in Sitecore Docker

You can also spin up images independently in a similar way to examine the contents (Run Interactive in VSCode using the docker extension).

So you may ask, what does this have to do with Sitecore?

The answer is simply that, with increasing adoption of Sitecore on Docker, there is a need for understanding more of how docker is used in the Sitecore ecosystem. As it pertains to this tip, many developers often wonder how they would layer in various modules and how to do build files. Knowing the filesystem in a module's image, by spinning it up and browsing, gives insight in what is required for a custom build file for example.

      COPY --from=sxa \module\tools \module\tools

    

Tells the developer that there is a directory called modules\tools in the "sxa" image, which has important contents to be copied when doing a custom build of the CM container.

In upcoming tips, I will explore more the concept of layering modules in a build file.

Cheers.

👋 Hey Sitecore Enthusiasts!

Sign up to our bi-weekly newsletter for a bite-sized curation of valuable insight from the Sitecore community.

What’s in it for you?

  • Stay up-to-date with the latest Sitecore news
  • New to Sitecore? Learn tips and tricks to help you navigate this powerful tool
  • Sitecore pro? Expand your skill set and discover troubleshooting tips
  • Browse open careers and opportunities
  • Get a chance to be featured in upcoming editions
  • Learn our secret handshake
  • And more!
Sitecore Snack a newsletter by Fishtank Consulting