Docker

Contents

Introduction

Installation

Dockerfiles

Debian/Ubuntu using apt-get

CentOS/RedHat using yum

Alpine Linux

Check Installation

 

Introduction

This page includes instructions for setting up OverOps in docker containers.

 

Installation

OverOps can be installed inside Docker containers by installing the dedicated Takipi for containers (TFC) version. This version is tailored to run inside docker.

To install OverOps within you container, please follow these steps:

  1. Create a OverOps user and get your installation secret key.
  2. Add the following snippet to your Dockerfile in order to install OverOps for container:
    Debian/Ubuntu using apt-get
    RUN wget -O - -o /dev/null http://get.takipi.com/takipi-t4c-installer | bash /dev/stdin -i --sk=<secret key>
    CentOS/RedHat using yum
    RUN curl -Ls /dev/null http://get.takipi.com/takipi-t4c-installer | bash /dev/stdin -i --sk=<secret key>

     

  3. Add the Takipi agent library -agentlib:TakipiAgent to your JVM arguments:
    CMD java -agentlib:TakipiAgent -jar yourjar.jar

 

Dockerfiles

In order to get OverOps inside your docker applications you’ll have to add the following snippet to your docker file, we’ve highlighted the parts specifically relevant to installing OverOps.
 

apt-get

Here’s a sample Dockerfile, you can access it on GitHub as well.

FROM ubuntu:15.10
MAINTAINER Chen Harel "https://github.com/chook"
RUN apt-get update
RUN apt-get install -y wget openjdk-8-jdk
RUN update-ca-certificates -f
RUN wget -O - -o /dev/null http://get.takipi.com/takipi-t4c-installer | bash /dev/stdin -i --sk=<YOUR SECRET KEY>
RUN /opt/takipi/etc/takipi-setup-machine-name <YOUR CONTAINER NAME>
RUN wget https://s3.amazonaws.com/app-takipi-com/chen/scala-boom.jar -O scala-boom.jar
CMD java -agentlib:TakipiAgent -jar scala-boom.jar

yum

Here’s a sample Dockerfile, you can watch it also on GitHub

FROM centos:7
MAINTAINER Chen Harel "https://github.com/chook"
RUN yum install -y java-1.8.0-openjdk.x86_64
RUN curl -Ls /dev/null http://get.takipi.com/takipi-t4c-installer | bash /dev/stdin -i --sk=<YOUR SECRET KEY>
RUN curl -o scala-boom.jar -L https://s3.amazonaws.com/app-takipi-com/chen/scala-boom.jar
CMD java -agentlib:TakipiAgent -jar scala-boom.jar

alpine linux

Here’s a sample Dockerfile, you can watch it also on GitHub

FROM alpine:3.2

MAINTAINER Chen Harel "https://github.com/chook"

# Install dependencies
RUN apk --update add curl ca-certificates tar sqlite icu bash && \
curl -Ls https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-2.21-r2.apk > /tmp/glibc-2.21-r2.apk && \
apk add --allow-untrusted /tmp/glibc-2.21-r2.apk

# Java version
ENV JAVA_VERSION_MAJOR 7
ENV JAVA_VERSION_MINOR 79
ENV JAVA_VERSION_BUILD 15
ENV JAVA_PACKAGE jdk

# Download and unarchive Java
RUN mkdir /opt && curl -jksSLH "Cookie: oraclelicense=accept-securebackup-cookie"\
http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz \
| tar -xzf - -C /opt &&\
ln -s /opt/jdk1.7.0_79 /opt/jdk &&\
rm -rf /opt/jdk/*src.zip \
/opt/jdk/lib/missioncontrol \
/opt/jdk/lib/visualvm \
/opt/jdk/lib/*javafx* \
/opt/jdk/jre/lib/plugin.jar \
/opt/jdk/jre/lib/ext/jfxrt.jar \
/opt/jdk/jre/bin/javaws \
/opt/jdk/jre/lib/javaws.jar \
/opt/jdk/jre/lib/desktop \
/opt/jdk/jre/plugin \
/opt/jdk/jre/lib/deploy* \
/opt/jdk/jre/lib/*javafx* \
/opt/jdk/jre/lib/*jfx* \
/opt/jdk/jre/lib/amd64/libdecora_sse.so \
/opt/jdk/jre/lib/amd64/libprism_*.so \
/opt/jdk/jre/lib/amd64/libfxplugins.so \
/opt/jdk/jre/lib/amd64/libglass.so \
/opt/jdk/jre/lib/amd64/libgstreamer-lite.so \
/opt/jdk/jre/lib/amd64/libjavafx*.so \
/opt/jdk/jre/lib/amd64/libjfx*.so \
&& addgroup -g 999 app && adduser -D -G app -s /bin/false -u 999 app \
&& rm -rf /tmp/* \
&& rm -rf /var/cache/apk/* \
&& echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf

# Set environment
ENV JAVA_HOME /opt/jdk
ENV PATH ${PATH}:/opt/jdk/bin

### Takipi Installation

# Takipi installer dependencies (we need xz for a future untar process)
RUN apk --update add xz

# Download required libraries libgcc_s.so.1, libstdc++.so.6
RUN curl -Ls https://www.archlinux.org/packages/core/x86_64/gcc-libs/download > /tmp/gcc-libs.tar.gz && \
mkdir /usr/libgcc && tar -xvf /tmp/gcc-libs.tar.gz -C /usr/libgcc

# Download required libraries libz.so.1
RUN curl -Ls https://www.archlinux.org/packages/core/x86_64/zlib/download/ > /tmp/zlib.tar.gz && \
mkdir /usr/zlib && tar -xvf /tmp/zlib.tar.gz -C /usr/zlib

# Register the new libraries (before starting the Takipi installation process)
RUN echo /usr/zlib/usr/lib >> /etc/ld.so.conf
RUN echo /usr/libgcc/usr/lib >> /etc/ld.so.conf
RUN /usr/glibc/usr/bin/ldconfig

# Starting the default run level to avoid errors while starting Takipi
RUN rc default

# Install Takipi
RUN curl -s /dev/null http://s3.amazonaws.com/get.takipi.com/takipi-t4c-installer | \
bash /dev/stdin -i --sk=

# Register Takipi libraries
RUN echo /opt/takipi/lib >> /etc/ld.so.conf
RUN /usr/glibc/usr/bin/ldconfig

# We must add Takipi to the PATH so the agent be able to start Takipi by itself
ENV PATH ${PATH}:/opt/takipi/bin

### Takipi installation complete

# Get a Java tester app
RUN wget https://s3.amazonaws.com/app-takipi-com/chen/scala-boom.jar -O scala-boom.jar

# Running a Java process with Takipi
CMD java -agentlib:TakipiAgent -jar scala-boom.jar

 

Check Installation

Make sure OverOps is up and running on your system: head back to app.overops.com, and click .

If the installation was successful, a “OverOps is active” message will be displayed, and a green “Monitoring” message will appear next to your JVM(s).

 

Have more questions? Submit a request