Friday, March 13, 2015

How to set up Shareable Docker Image for Adobe CQ/AEM

Use case

  • Large Set up time for developers
  • Inconsistent environments across all boxes
  • Flexible in container testing
  • No Single repository for whole system artifacts 

What is Docker

Docker is a platform for developers and sysadmins to develop, ship, and run applications. Docker lets you quickly assemble applications from components and eliminates the friction that can come when shipping code. Docker lets you get your code tested and deployed into production as fast as possible.
More information about Docker can be found here
Check Docker Cheat sheet:

Set up

Docker requires two part to work,
  • Docker Hub or Docker registry (Where images are stored). You don't have to set up this part. We already have a private docker registry set up for you.
  • Docker client (To work with docker images). You need to install this in your local. Please check and based on your OS you need to install one. I have instruction to install it on Redhat Linux.

What would you get after following below instruction ?

  1. A Private Docker Hub, where you can manage AEM docker package. 
  2. A docker Image that will have author, publish and dispatcher instance.
  3. Steps to manage your docker hub and local image and make changes to them.

Assumption: I have docker registry set up for Red hat Linux. You might need different steps for different OS. I assume that on your OS mount you have a mount for /export. If this mount is not there then change paths in script.

Docker is only supported FOR RED HAT LINUX VERSION > 6.5 
(Use command cat /etc/*release to find your linux version)

Set Up Private Docker Registry


If you are using redhat then 


Set Up docker Image using docker file

Once docker is install create a dummy directory and put your jar file, license file, Hotfix and other files in to it. More information about Docker file


1) You have AEM jar file
2) You have License File
3) You have your version of JDK
4) You have compiled HTTPD
5) They all are in same folder where Dockerfile is

For this create a file called Dockerfile and copy below. MAKE CHANGES BASED ON YOUR REQUIREMENT

Once Docker file is there build and create your private docker image using following command. This will create a shareable docker image

Once Docker registry is installed and you have shareable image, now you can install docker client on any other machine

Set up Docker Client

Prerequisite: Based on your OS please install docker client using

Change default path if there is not enough space

Docker by default get installed under /var/lib/docker in Red Hat. Make sure that you have enough space there. If not then you have to do following.

Set Up docker for Non SSL version

By default Docker uses SSL to communicate to docker registry. If you do not have valid cert installed then you might need to do following

Set up local docker instance using docker client

Do following to start your local AEM instance using docker registry and docker client

How to update docker image

Please follow below step to update your docker image

Symptom: You are not able to access your instance from external machine
Solution: Try to restart your machine using 'reboot' for linux box and restart in mac
Symptom: Docker is not starting on mac
Solution: Make sure that you have localhost entry in /etc/hosts file. e.g. localhost. then do following

boot2docker delete
boot2docker download
boot2docker init
boot2docker up
# End of this you will be asked to add some env variable in your ~/.bash_profile
# Open bash profile and add them

Symptom: Getting following error in mac
FATA[0032] An error occurred trying to connect: Get dial tcp i/o timeout

boot2docker stop
boot2docker destroy
boot2docker init
boot2docker up
docker version

Symptom: On Mac local box not able to access instance using localhost:<port number> (

# Run following command
echo "$(boot2docker ip) localhost" | sudo tee -a /etc/hosts
# Then access your instance using localhost
# If you want to create other vhost then change above command with your vhost. For example
echo "$(boot2docker ip)" | sudo tee -a /etc/hosts

Some use full docker command

Upload content

You can use Recap tool to install content once image is set up. You can even put this recap tool as part of your image when you are creating docker image. Just put them under install folder. 

Note that every time you update your image, Uploaded content or local changes might get overriden. You have to commit your changes using docker commit and then apply update on top of that and then share your image.

Useful resource:

Note: As usual let me know if you have any question.


  1. Thanks for your sharing. Nice blog post.

    I followed your dockerfile instruction to create a CQ 5.6.1 shareable image, somehow after created image and ran the container, I can see author instance working but not publish instance.

    Do you have any idea about that?

    1. Hello Javafun,

      Do you still have this issue ? Both Author and publish should work using step above.


  2. I am profoundly pulled in by your post. It is truly a decent and useful one. I will prescribe it to my companions.
    Help With Programming Assignment

  3. Thanks for sharing the info, keep up the good work going.... I really enjoyed exploring your site. good resource. 
    Simul8  Assignment Help

  4. Probably the scariest thing about cemeteries is that best cat pumpkin carving ] music they play in your head when you drive by one. Charlie Brown is the one person I identify with. C.B. is such a loser. best jack o lantern patterns He wasn't even the star of his own Halloween special.