Finally! AMIRITE? Now that we’ve spun our solr and sql containers up, it’s time to move to the big guns: The CM Server. I’m not going to cover the CD Server, as it’s fairly similar. XP topology is also not very far deviant from the concepts you’ve conquered so far. Let’s get to it. The good news is, we’ve create all the base images for the CM image. Woot! Let’s look at that Dockerfile though, and see whats’ going on. It’s a bit to take in:

So woof. There’s a lot to have in there. One thing you WON’T notice is SIF. These Dockerfiles are sans-SIF (like the font, right?) which, honestly is just a reduction of complexity and a pretty good idea, if you ask me. With this Dockerfile, let’s setup our instance of Sitecore!

This looks a little more like Sitecore. We see the path to the WDP (which is now in the Assets Image. We see our config to change the role (CM vs CD here) and we see the Role Define which will be used to transform the web.config as it moves into the Image. Here’s our new Image list:

This feels fresh.

Let’s go ahead and spin our container up and check it out:

A quick thing to point out here: For simplicity, the license file is kept OUTSIDE the container, which means you’re going to need a secondary mount. That’s fine, you can have as many as you want to. Just make sure you license file is in the source folder.

Let’s run it! Open up your browser and visit http://localhost:44000 ahhhh what. It isn’t working???

Well this isn’t good. But it isn’t unexpected, either.

Unfortunately, containers a, by nature, isolated. That’s cool though, we can fix that. What we need to do is, is create a network for them to talk over. If you run the following command, you’ll see what networks are there out of the box:

Out of the box networks

We see four out of the box. We could attempt to attach our containers directly to the ‘nat’ network, but that wouldn’t entirely fix our issue. We really want to be able to name our containers on the network. That’s pretty easy once we have a network. So let’s make one and call it something logical:

All that does is make a new network of type ‘nat’, and name it. We should see this now in our network list:

Oh hi there, new network

Cool cool cool. Let’s put our containers on that network now:

The important thing here comes in the alias option. We’re able to name the container on the network, and when we request http://solr:8983, it’ll find our solr_xm_920 container. Pretty neat? Let’s refresh that browser:

SUCCESS! We now have Sitecore running in a docker container, connected to solr in a docker container as well as sql in a docker container. All running in an isolated network. Nice work!

Can we make this easier? It’s a little laborious spinning all the containers up, adding to network, validating the shares, etc. Let’s call our friend Docker Compose for some assistance. He’s hanging out in Part 9: Compose all the Things.

The TL;DR Code

This is a post in the "Yet Another Sitecore Docker Series." Other Posts include