Skip to content

Instantly share code, notes, and snippets.

#This is to avoid following error
# FATA[0000] Error: Invalid registry endpoint certificate signed by unknown authority. If this private registry supports only HTTP or HTTPS # with an unknown CA certificate, please add `--insecure-registry HOST` to the daemon's arguments. In the case of HTTPS, if you have access # to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/HOST/ca.crt
# For red hat Linux
vi /etc/sysconfig/docker
# Add following line
other_args="--insecure-registry <Your-Registry-HOST>"
service docker restart
# For Mac book
@yupadhyay
yupadhyay / docker_change_location.sh
Created March 13, 2015 18:01
By default docker get installed under /var/lib/docker . If you don't have enough space there then you might have to do following
#Check if /var is getting filled
df -k
#If /var space is not more than 50GB do following
sudo su
#Stop Docker
service docker stop
#Copy all files to folder that have enough space
#usually in linux boxes there is enough space under /export
#Create a dummy directory 'mkdir /export/apps/docker'
cp -R /var/lib/docker/ <Your other folder>
@yupadhyay
yupadhyay / build_aem_docker_image.sh
Created March 13, 2015 17:44
Command to create docker Image
#Make sure that you run this command from same directory where docker file is
#Also makes sure that all files are at same location
docker build --tag="localhost:5000/wemblog/microsites_aem:5.6" .
#Make sure that image exist before push
docker images
#Push image to registry
docker push localhost:5000/wemblog/microsites_aem:5.6
@yupadhyay
yupadhyay / aem_docker_image.sh
Created March 13, 2015 17:40
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
#Install Docker Client
yum -y remove docker
yum install docker-io
yum -y update docker-io
#This will start docker deamon
service docker start
#Install docker registry
yum install python-devel libevent-devel python-pip gcc xz-devel
python-pip install docker-registry[bugsnag,newrelic,cors]
cd <Mongo bin directory>
./mongo
# Show all db
show dbs
# Check status of replica set
rs.status()
# If this is secondary you need to do
rs.slaveOk()
# Use database (Use AEM DB or DB you chose)
use <data-base-name>
cd <Mongo bin directory>
use admin
db.shutdownServer()
#Take Backup
./mongodump --dbpath ../data/<NAME OF DB> -o dataout
# Now set up new Mongo DB servers that you want to add in replica set Instruction above
# Now start your existing Mongo Using following command, Note that this time we are using replSet
# You can also do this using Mongo DB configuration file
./mongod --port 27017 --dbpath <your DB path> --replSet <Replica set Name> &
#Connect to the mongodb instance
# Unpack AEM jar using
java -jar <AEM Jar> -unpack
# Go to bin directory
cd crx-quickstart/bin
#Change syour start script
vi start
#Set runmode to crx3mongo
cd <Your Mongo bin Location>
# You can also configure port using configuration file
./mongo --port <PORT>
rs.initiate()
# Check the conf that it is not part of replica set yet
rs.conf()
#This is your second Mongo Instance, Make sure that your other Mongo Instance is already set up
rs.add("<HOST>:<PORT>")
#This is your Third Mongo Instance (You need to have odd number of instances for election to work)
rs.add("<HOST>:<PORT>")
<dependencies>
<!-- OSGi Dependencies -->
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr</artifactId>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>