top of page

No connection could be made because the target machine actively refused it. - Sitecore Docker

  • Writer: Gowtham
    Gowtham
  • Jul 20, 2023
  • 1 min read

While attempting to install the Sitecore Docker Containers template for Next.js, I encountered the following error. Despite having installed all the necessary prerequisites for Sitecore Docker, the error persisted. Unfortunately, my internet search for a direct solution based on the error yielded no results. Consequently, I decided to address this issue by writing an article about it.


Error:

Invoke-RestMethod: D:\Playground\MyProject\up.ps1:49
Line |
  49 |  …   $status = Invoke-RestMethod "http://localhost:8079/api/http/routers …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | No connection could be made because the target machine actively refused it.
 

Solution

The error originates from the fact that the Getting Started template includes docker compose V1. To address this, we must upgrade it to V2. Please follow the instructions below for migrating to V2.

  • Make sure that the "Use Docker Compose V2" option is selected in your Docker Desktop settings. You can enable this option by navigating to Docker Desktop Settings -> General -> Use Docker Compose V2 -> Apply & restart.

use-docker-compose-v2
  • Open the up.ps1 file and locate the "docker-compose" text. Replace it with "docker compose" and then save the changes to the file.

  • Open the docker-compose.override.yml file replace the scale:0 with

    deploy:
      replicas: 0
  • Within the same file, locate the provided command and replace it with the specified alternative command.

entrypoint: powershell.exe -Command "& C:\tools\entrypoints\iis\Development.ps1"
entrypoint: powershell.exe -Command "& C:\\tools\\entrypoints\\iis\\Development.ps1"

Now execute the .\up.ps1 script, and this time, you will no longer encounter the error. Enjoy your seamless Sitecore experience!


References

תגובות


Never Miss a Post. Subscribe Now!

Thanks for submitting!

bottom of page