Skip to content

Instantly share code, notes, and snippets.

@yupadhyay
Created March 13, 2015 17:40
Show Gist options
  • Save yupadhyay/8019f9fcb4305d96ee81 to your computer and use it in GitHub Desktop.
Save yupadhyay/8019f9fcb4305d96ee81 to your computer and use it in GitHub Desktop.
Docker file for creating initial AEM image. This Assumes that you already have AEM jar file. You already have compiled version of httpd. You have JDK folder. Before using this you have to make sure that they all are placed in same folder where Docker file is
FROM centos
#Install and set java home
RUN mkdir -p /export/apps/jdk
ADD JDK-1_7_0_51 /export/apps/jdk/JDK-1_7_0_51
ENV JAVA_HOME /export/apps/jdk/JDK-1_7_0_51
ENV PATH $PATH:$JAVA_HOME/bin
#Install CQ Author
RUN mkdir -p /export/apps/aem/author
WORKDIR /export/apps/aem/author
ADD cq5-publish-p4503.jar /export/apps/aem/author/cq5-author-p4502.jar
ADD license.properties /export/apps/aem/author/license.properties
RUN java -jar cq5-author-p4502.jar -unpack -v
ADD quickstart_author /export/apps/aem/author/crx-quickstart/bin/quickstart
RUN mkdir -p /export/apps/aem/author/crx-quickstart/install
ADD hotfix/* /export/apps/aem/author/crx-quickstart/install/
#Now start Publish Instance
RUN mkdir -p /export/apps/aem/publish
WORKDIR /export/apps/aem/publish
ADD cq5-publish-p4503.jar /export/apps/aem/publish/cq5-publish-p4503.jar
ADD license.properties /export/apps/aem/publish/license.properties
RUN java -jar cq5-publish-p4503.jar -unpack -v
ADD quickstart_publish /export/apps/aem/publish/crx-quickstart/bin/quickstart
RUN mkdir -p /export/apps/aem/publish/crx-quickstart/install
#Add your hotfixes here
ADD hotfix/* /export/apps/aem/publish/crx-quickstart/install/
#Set up all CQ ENV
ENV CQ_FOREGROUND y
ENV CQ_VERBOSE y
ENV CQ_NOBROWSER y
ENV CQ_JVM_OPTS "-server -Xmx1524M -Xms512M -XX:MaxPermSize=512M"
#Now install Dispatcher
ADD httpd /export/apps/httpd
RUN chmod -R 777 /export/apps/httpd/bin
RUN ln -sf /export/apps/httpd/modules/dispatcher-apache2.2-4.1.2.so /export/apps/httpd/modules/mod_dispatcher.so
ADD www /export/www
RUN chown -R daemon:daemon /export/www
WORKDIR /export/apps
#Add supervisor to run multiple deamon
RUN yum install -y epel-release && \
yum install -y supervisor && \
yum clean all
EXPOSE 80 443 4502 4503
# supervisor is needed to run multiple process in same docker image
RUN echo "[supervisord]" > /etc/supervisord.conf && \
echo "nodaemon=true" >> /etc/supervisord.conf && \
echo "" >> /etc/supervisord.conf && \
echo "[program:aem_author]" >> /etc/supervisord.conf && \
echo "command=/export/apps/aem/author/crx-quickstart/bin/quickstart" >> /etc/supervisord.conf && \
echo "" >> /etc/supervisord.conf && \
echo "[program:aem_publish]" >> /etc/supervisord.conf && \
echo "command=/export/apps/aem/publish/crx-quickstart/bin/quickstart" >> /etc/supervisord.conf && \
echo "" >> /etc/supervisord.conf && \
echo "[program:httpd]" >> /etc/supervisord.conf && \
echo "command=/export/apps/httpd/bin/apachectl -D FOREGROUND" >> /etc/supervisord.conf
CMD ["/usr/bin/supervisord"]
@javafun
Copy link

javafun commented Aug 4, 2015

Thank you for the nice script, can you please add some screenshots about the folder structure you used? I followed your website instruction, but I can't make it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment