- Large Set up time for developers
- Inconsistent environments across all boxes
- Flexible in container testing
- No Single repository for whole system artifacts
What is DockerDocker 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 https://docs.docker.com/
Check Docker Cheat sheet: https://github.com/wsargent/docker-cheat-sheet
Set upDocker 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 https://docs.docker.com/installation/ 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 ?
- A Private Docker Hub, where you can manage AEM docker package.
- A docker Image that will have author, publish and dispatcher instance.
- 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 https://docs.docker.com/reference/builder/
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 registry is installed and you have shareable image, now you can install docker client on any other machine
Set up Docker Client
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 imagePlease 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. 127.0.0.1 localhost. then do following
Symptom: Getting following error in mac
Symptom: On Mac local box not able to access instance using localhost:<port number> (https://docs.docker.com/installation/mac/)
Some use full docker command
You can use Recap tool http://adamcin.net/net.adamcin.recap/ 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: http://www.techinsight.io/review/adobe-experience-manager/incontainer-testing-for-aem-with-docker/
Note: As usual let me know if you have any question.