From 4b68bab48d1869638fe1596c6e6d39f02e08aa79 Mon Sep 17 00:00:00 2001 From: Dawid Malinowski Date: Thu, 9 Jul 2015 14:42:38 +0200 Subject: [PATCH 1/5] Rmove cluster zookeeper configuration --- pinpoint-web/pinpoint-web.properties | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pinpoint-web/pinpoint-web.properties b/pinpoint-web/pinpoint-web.properties index b61c347..2d833f0 100644 --- a/pinpoint-web/pinpoint-web.properties +++ b/pinpoint-web/pinpoint-web.properties @@ -1,9 +1,8 @@ # local cluster.enable=false cluster.web.tcp.port=9995 -cluster.zookeeper.address=127.0.0.1:22213 -cluster.zookeeper.sessiontimeout=3000 -cluster.zookeeper.retry.interval=5000 +cluster.zookeeper.address= +cluster.zookeeper.sessiontimeout= # FIXME - should be removed for proper authentication admin.password=admin From 56c929bba70f38fdb859985bd9cbe922cecbe367 Mon Sep 17 00:00:00 2001 From: Dawid Malinowski Date: Thu, 9 Jul 2015 15:52:17 +0200 Subject: [PATCH 2/5] Move to alpine:3.2 --- pinpoint-agent/Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pinpoint-agent/Dockerfile b/pinpoint-agent/Dockerfile index a630680..e58a0e7 100644 --- a/pinpoint-agent/Dockerfile +++ b/pinpoint-agent/Dockerfile @@ -2,12 +2,11 @@ # TO_BUILD docker build -t pinpoint-agent . # TO_RUN docker run --name=pinpoint-agent pinpoint-agent -#FROM progrium/busybox:latest -FROM java:8-jdk +FROM alpine:3.2 ENV PINPOINT_VERSION 1.1.0 -#RUN opkg-install bash curl +RUN apk add --update curl bash RUN mkdir -p /opt/app \ && curl -L -O -k "https://github.com/naver/pinpoint/releases/download/$PINPOINT_VERSION/pinpoint-agent-$PINPOINT_VERSION.tar.gz" -o pinpoint-agent.tar.gz \ @@ -16,3 +15,5 @@ RUN mkdir -p /opt/app \ && rm pinpoint-agent-$PINPOINT_VERSION.tar RUN sed -i 's/profiler.collector.ip=127.0.0.1/profiler.collector.ip=192.168.59.103/' /opt/app/pinpoint-agent/pinpoint.config + +VOLUME /opt/app/pinpoint-agent \ No newline at end of file From 74833f5e54b7c2a6002150ba9b3ab7d69206f5ed Mon Sep 17 00:00:00 2001 From: Dawid Malinowski Date: Thu, 9 Jul 2015 16:55:29 +0200 Subject: [PATCH 3/5] Reconfigure and add CMD for pinpoint-agent --- pinpoint-agent/Dockerfile | 7 +++++-- pinpoint-agent/configure.sh | 7 +++++++ pinpoint-collector/Dockerfile | 18 +++++++++--------- pinpoint-hbase/Dockerfile | 20 ++++++++++---------- pinpoint-web/Dockerfile | 15 +++++++-------- 5 files changed, 38 insertions(+), 29 deletions(-) create mode 100644 pinpoint-agent/configure.sh diff --git a/pinpoint-agent/Dockerfile b/pinpoint-agent/Dockerfile index e58a0e7..30b3456 100644 --- a/pinpoint-agent/Dockerfile +++ b/pinpoint-agent/Dockerfile @@ -14,6 +14,9 @@ RUN mkdir -p /opt/app \ && tar -xf pinpoint-agent-$PINPOINT_VERSION.tar -C /opt/app \ && rm pinpoint-agent-$PINPOINT_VERSION.tar -RUN sed -i 's/profiler.collector.ip=127.0.0.1/profiler.collector.ip=192.168.59.103/' /opt/app/pinpoint-agent/pinpoint.config +ADD configure.sh /configure.sh +RUN chmod a+x /configure.sh -VOLUME /opt/app/pinpoint-agent \ No newline at end of file +VOLUME /opt/app/pinpoint-agent + +CMD ["/configure.sh"] \ No newline at end of file diff --git a/pinpoint-agent/configure.sh b/pinpoint-agent/configure.sh new file mode 100644 index 0000000..da07c31 --- /dev/null +++ b/pinpoint-agent/configure.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e +set -x + +COLLECTOR_IP=${COLLECTOR_IP:-} + +sed -i 's/profiler.collector.ip=127.0.0.1/profiler.collector.ip=${COLLECTOR_IP}/' /opt/app/pinpoint-agent/pinpoint.config diff --git a/pinpoint-collector/Dockerfile b/pinpoint-collector/Dockerfile index c4c82ee..d7bcc51 100644 --- a/pinpoint-collector/Dockerfile +++ b/pinpoint-collector/Dockerfile @@ -6,15 +6,15 @@ FROM tomcat:8-jre8 ENV PINPOINT_VERSION 1.1.0 -RUN curl -SL "https://github.com/naver/pinpoint/releases/download/$PINPOINT_VERSION/pinpoint-collector-$PINPOINT_VERSION.war" -o pinpoint-collector.war && \ - rm -rf /usr/local/tomcat/webapps && \ - mkdir -p /usr/local/tomcat/webapps && \ - sed -i -e 's/8005/9005/' /usr/local/tomcat/conf/server.xml && \ - sed -i -e 's/8080/9080/' /usr/local/tomcat/conf/server.xml && \ - sed -i -e 's/8009/9009/' /usr/local/tomcat/conf/server.xml && \ - sed -i -e 's/8443/9443/' /usr/local/tomcat/conf/server.xml && \ - unzip pinpoint-collector.war -d /usr/local/tomcat/webapps/ROOT && \ - rm -rf pinpoint-collector.war +RUN curl -SL "https://github.com/naver/pinpoint/releases/download/$PINPOINT_VERSION/pinpoint-collector-$PINPOINT_VERSION.war" -o pinpoint-collector.war \ + && rm -rf /usr/local/tomcat/webapps \ + && mkdir -p /usr/local/tomcat/webapps \ + && sed -i -e 's/8005/9005/' /usr/local/tomcat/conf/server.xml \ + && sed -i -e 's/8080/9080/' /usr/local/tomcat/conf/server.xml \ + && sed -i -e 's/8009/9009/' /usr/local/tomcat/conf/server.xml \ + && sed -i -e 's/8443/9443/' /usr/local/tomcat/conf/server.xml \ + && unzip pinpoint-collector.war -d /usr/local/tomcat/webapps/ROOT \ + && rm -rf pinpoint-collector.war ADD start.sh /usr/local/tomcat/start.sh RUN chmod a+x /usr/local/tomcat/start.sh diff --git a/pinpoint-hbase/Dockerfile b/pinpoint-hbase/Dockerfile index 5fce92a..f9fd3b6 100644 --- a/pinpoint-hbase/Dockerfile +++ b/pinpoint-hbase/Dockerfile @@ -9,19 +9,19 @@ ENV HBASE_VERSION 1.0.1.1 ENV HBASE_HOME /opt/hbase/hbase-$HBASE_VERSION ENV PINPOINT_VERSION 1.1.0 -RUN mkdir -p /opt/hbase && \ - cd /opt/hbase && \ - curl -SL "http://apache.mirrors.pair.com/hbase/$HBASE_VERSION/hbase-$HBASE_VERSION-bin.tar.gz" -o hbase.tar.gz && \ - tar xfvz hbase.tar.gz && \ +RUN mkdir -p /opt/hbase \ + && cd /opt/hbase \ + && curl -SL "http://apache.mirrors.pair.com/hbase/$HBASE_VERSION/hbase-$HBASE_VERSION-bin.tar.gz" -o hbase.tar.gz \ + && tar xfvz hbase.tar.gz \ rm -rf hbase.tar.gz ADD hbase-site.xml /opt/hbase/hbase-$HBASE_VERSION/conf/hbase-site.xml -RUN curl -SL "https://raw.githubusercontent.com/naver/pinpoint/$PINPOINT_VERSION/scripts/hbase-create.hbase" -o /opt/hbase/hbase-create.hbase && \ - $HBASE_HOME/bin/start-hbase.sh && \ - sleep 10 && \ - $HBASE_HOME/bin/hbase shell /opt/hbase/hbase-create.hbase && \ - $HBASE_HOME/bin/stop-hbase.sh +RUN curl -SL "https://raw.githubusercontent.com/naver/pinpoint/$PINPOINT_VERSION/scripts/hbase-create.hbase" -o /opt/hbase/hbase-create.hbase \ + && $HBASE_HOME/bin/start-hbase.sh \ + && sleep 10 \ + && $HBASE_HOME/bin/hbase shell /opt/hbase/hbase-create.hbase \ + && $HBASE_HOME/bin/stop-hbase.sh VOLUME /home/pinpoint/hbase VOLUME /home/pinpoint/zookeeper @@ -37,4 +37,4 @@ EXPOSE 60020 # HBase Regionserver web UI EXPOSE 60030 -CMD /opt/hbase/hbase-$HBASE_VERSION/bin/hbase master start +CMD ["/opt/hbase/hbase-$HBASE_VERSION/bin/hbase", "master", "start"] diff --git a/pinpoint-web/Dockerfile b/pinpoint-web/Dockerfile index 49e9007..61d91a9 100644 --- a/pinpoint-web/Dockerfile +++ b/pinpoint-web/Dockerfile @@ -6,18 +6,17 @@ FROM tomcat:8-jre8 ENV PINPOINT_VERSION 1.1.0 -RUN curl -SL "https://github.com/naver/pinpoint/releases/download/$PINPOINT_VERSION/pinpoint-web-$PINPOINT_VERSION.war" -o pinpoint-web.war && \ - rm -rf /usr/local/tomcat/webapps && \ - mkdir -p /usr/local/tomcat/webapps && \ - unzip pinpoint-web.war -d /usr/local/tomcat/webapps/ROOT && \ - rm -rf pinpoint-web.war - ADD start.sh /usr/local/tomcat/start.sh -RUN chmod a+x /usr/local/tomcat/start.sh - ADD hbase.properties /assets/hbase.properties ADD pinpoint-web.properties /assets/pinpoint-web.properties +RUN chmod a+x /usr/local/tomcat/start.sh\ + && curl -SL "https://github.com/naver/pinpoint/releases/download/$PINPOINT_VERSION/pinpoint-web-$PINPOINT_VERSION.war" -o pinpoint-web.war \ + && rm -rf /usr/local/tomcat/webapps \ + && mkdir -p /usr/local/tomcat/webapps \ + && unzip pinpoint-web.war -d /usr/local/tomcat/webapps/ROOT \ + && rm -rf pinpoint-web.war + EXPOSE 8080 CMD ["/usr/local/tomcat/start.sh"] From 65ec8df3667786c2c397e719c76d6c9af896db64 Mon Sep 17 00:00:00 2001 From: Dawid Malinowski Date: Thu, 9 Jul 2015 17:13:44 +0200 Subject: [PATCH 4/5] Fix build --- pinpoint-hbase/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pinpoint-hbase/Dockerfile b/pinpoint-hbase/Dockerfile index f9fd3b6..7d3333f 100644 --- a/pinpoint-hbase/Dockerfile +++ b/pinpoint-hbase/Dockerfile @@ -13,7 +13,7 @@ RUN mkdir -p /opt/hbase \ && cd /opt/hbase \ && curl -SL "http://apache.mirrors.pair.com/hbase/$HBASE_VERSION/hbase-$HBASE_VERSION-bin.tar.gz" -o hbase.tar.gz \ && tar xfvz hbase.tar.gz \ - rm -rf hbase.tar.gz + && rm -rf hbase.tar.gz ADD hbase-site.xml /opt/hbase/hbase-$HBASE_VERSION/conf/hbase-site.xml From 83fe2cc2071ebac7273c0c52bf1388c419f4dad0 Mon Sep 17 00:00:00 2001 From: Dawid Malinowski Date: Thu, 9 Jul 2015 17:46:50 +0200 Subject: [PATCH 5/5] Fix with sed and env --- pinpoint-agent/configure.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pinpoint-agent/configure.sh b/pinpoint-agent/configure.sh index da07c31..2c535a5 100644 --- a/pinpoint-agent/configure.sh +++ b/pinpoint-agent/configure.sh @@ -4,4 +4,4 @@ set -x COLLECTOR_IP=${COLLECTOR_IP:-} -sed -i 's/profiler.collector.ip=127.0.0.1/profiler.collector.ip=${COLLECTOR_IP}/' /opt/app/pinpoint-agent/pinpoint.config +sed -i 's/profiler.collector.ip=127.0.0.1/profiler.collector.ip='"${COLLECTOR_IP}"'/' /opt/app/pinpoint-agent/pinpoint.config