blog image

How to Set Up Docker Dispatcher the same as Cloud Manager

  • icons26 January, 2022
  • iconsTushar Mane

The dispatcher module in Adobe Experience Manager can be used for security, caching, load balancing, reverse proxy, and sorting through client requests to AEM publishing instances. This load balancing tool can be used alongside an enterprise-class web server.

By blocking access from unknown sources using filters, dispatchers protect your AEM publish servers from threats and attacks. In short, dispatchers are the lens through which users will view content on the AEM publisher. In this article, we’ll be guiding you on how to set up a Docker Dispatcher in a simple manner. But before we jump right in, let’s understand the essence of dispatchers for AEM.

The Essence of Dispatchers for Your Local AEM

More often than not we’ve seen the DevOps teams as the primary owner and maintainer of dispatcher configuration. They also need to consult and rely on Developers to provide certain application specific requirements and details.

Developers generally don’t set up their own dispatchers locally. They don’t have full visibility or clarity into the entire dispatcher configuration especially if it’s not stored in a code repository accessible to them. This disconnect caused by the separation of responsibilities in some teams often leads to inconsistencies in environments and major headaches and delays when troubleshooting live issues.

In an ideal world defining and maintaining dispatcher configuration should be a shared responsibility between DevOps team and Dev team. The dispatcher configurations should be committed into GIT accessible to both teams. This is the standard pattern now even demonstrated by the new projects generated by the Archetype wherein the dispatcher configuration is committed in the same repo as code.

Developers can easily deploy the dispatcher configuration stored in a git repo to a local docker image thus giving them a production-like dispatcher set up locally.

In this article, we will walk through how to set up docker dispatcher the same as cloud manager in just a few minutes.

How to Set Up Docker Dispatcher

To set up the Docker Dispatcher, you have to follow a systematic approach.

Set up the Docker Desktop

The steps to set up the Docker Desktop are as follows:

  1. Download the Docker Desktop Installer.exe according to your operating system. Here are the links to do just so:
  2. Click on the installer once you download it. When the prompt shows up, make sure that the ‘Enable Hyper-V Windows Features’ or the ‘Install required Windows components for WSL 2’ options have been selected on the configuration page.
  3. Now, simply go ahead and follow the instructions on the installation wizard, to authorize the installer and move forward with the installation process.
  4. Once the installation is complete, simply press close to finish the install.
  5. Remember to add the user to the docker-users groups, in case your admin account and user account are different. First, run Computer Management as an administrator. Once that is done, head over to Local Users and Groups > Groups > Docker-users. Now, right-click to add the user to the group. You will have to logout and log back in for the changes to take effect.

Set up & Run the Dispatcher Validator

Here are a few simple steps for setting up and running the dispatcher validator to transpile dispatcher files into the format of the Docker container’s Apache Web Server support.

  1. Download the aem-sdk-xxx.zip file.
  2. Extract it from the zip.
  3. Head to <project-name>/dispatcher.
  4. Unpack the dispatcher tools into ~/aem-sdk/dispatcher
    • For Windows, unzip aem-sdk-dispatcher-tools-x.x.x-windows.zip into the dispatcher folder.
    • For Mac OS, unpack the dispatcher tools by executing the shell script aem-sdk-dispatcher-tools-x.x.x-unix.sh.
  5. Use the CD command to change to the dispatcher folder, and run the below given command:
    • For Windows: ./bin/validator full -d ./out ./src 
    • For Mac OS: bin\validator full -d out src

It is the validator’s job to validate all the dispatcher files in the SRC folder, and then further transpile them into a readable format. This is purely for the Apache HTTP web server in the Docker container.

Run the Docker AEM dispatcher image using the ./out folders dispatcher files

To successfully run the Docker AEM dispatcher image using the ./out folders, first make sure that you have the AEM publish instance running at 4503. If not, simply change the port using the following command:

  • 4503: Publish port to expose
  • 8080: Dispatcher port

Now that you have successfully changed the port, you are ready to boot your dispatcher. On successful transpilation, use the following command.

  • For Windows: bin/Docker_run out host.Docker.internal:4503 8080
  • For Mac OS: ./bin/Docker_run.sh ./out host.Docker.internal:4503 8080

On the execution of the above command, it will run a docker container that uses /out files and publisher port, along with its respective dispatcher mapping port.

This should give you a good idea of how to set up Docker Dispatcher the same as cloud manager. Just make sure you stick to the above steps for a successful Docker setup.

Are you still looking for support or guidance on how to set up docker dispatcher the same as cloud manager? Connect with us now to schedule a demo and learn how we can help.

About Initialyze

Founded in 2015 in San Francisco, Initialyze specializes in providing software solutions and services to help the world’s leading brands deliver transformation digital brand experiences. Our expertise includes Digital Strategy, Technology Implementation, Analytics, and Marketing. We strive to form strong partnerships with our clients to envision, design, and build innovative digital experiences efficiently and simply. Using an optimized implementation process and a suite of ready to use Initialyzers, we deliver on complex requirements quickly and cost-effectively without sacrificing on quality.

Leave A Comment

Your email address will not be published. Required fields are marked *