8

I've been trying to launch Sitecore 10 setup from docker-compose in docker-examples repository.

Compose was failing after spinning first 5 containers: solr, mssql, id, xconnect, cm.

After some investigation, I've found out that containers can't communicate with each other. So e.g. cm container can't ping mssql container.

docker exec sitecore-xp0_cm_1 ping mssql
0

4 Answers 4

10

It looks like it might be related to security policies within our company as I've been able to reproduce the same behaviour on other machines within the company. And it's working OK on non-company machines.

The solution that worked for me was to add hostnames to every container. e.g.:

  mssql:
    hostname: mssql
    isolation: ${ISOLATION}

...

  solr:
    hostname: solr
    isolation: ${ISOLATION}

...

  cm:
    hostname: cm
    isolation: ${ISOLATION}

Full changes can be found here.

Note, that adding hostname this way will make containers accessible from host machine, so that might cause conflicts if you try to spin up multiple repositories with the same container IDs.

2
  • thanks for this solution, which worked perfectly for me. I've one comment - I found it is better to utilize the variable name, already defined in the .env environment file for those of services, which are mentioned there. Like this: ' mssql: hostname: ${SQL_SERVER} '
    – Ramanagom
    Mar 1, 2022 at 14:22
  • I have three computers at my home. One from my company. I copied the solution and installed the same docker version everywhere. Only on my companies laptop it would bring the error "Cannot access SQL server..." no matter what. I tried everything, for many days. Finally, these IDs are the solution. Thanks!!
    – Tillito
    Sep 1, 2023 at 9:34
4

In my case I had an issue with the id container name as well. So besides adding hostnames for all containers I had to also change the hostname for the id to identity because it did not want to ping and then update the internal reference to it via using the environment variable:

id:
  hostname: identity

...

cm:
  hostname: cm
  environment:
    Sitecore_Identity_Server_InternalAuthority: http://identity
1
  • Where does Sitecore_Identity_Server_InternalAuthority come from? Jan 17, 2023 at 19:53
1

@vzaverugo Our internal team has found an alternate solution by setting the IP address of the docker host entries to something real like 1.1.1.1 or 8.8.8.8 instead of 127.0.0.1 and stopping the IIS completely. This seems to work fine within our company laptops configured with some policies.

1

I've had team members experiencing this, where even setting hostnames did not resolve it.

The solution was, switching them from process to hyperv isolation.

This happened only to some team members, not all. Never did find the root cause. But hyperv solved it across the board.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.