Dockers and Yellowfin

The following article will provide a quick and very basic summary on using Yellowfin in a Docker Container. You will also find 2 basic templates you can work with to create your own docker images going forward. This is not designed to teach you anything about how Docker works or how to build it as all of this information can be found online in the Docker help site or their community.

Firstly, Yellowfin works perfectly well in a Docker Container as long as you understand how a Docker container works and you take into consideration all of the state and network setup and configurations challenges that you might face. The main challenge is to ensure that the database you are going to connect to (whether another docker container, VM or physical) can actually be reached by the Docker container.

If you want to build a Yellowfin Docker Image with a contained Database or even want to ensure log preservation, then please ensure you read up on Volumes and/or Bind Mounts.

One of the main challenges with using dockers is within the licensing and how it can be done. Generally however, if you have a specific hostname attached to your licence, then you should simply be able to use the "--hostname" argument when starting the container to ensure that it is created with the right hostname. If this option does not work for you, such as when you are building a cluster of Yellowfin docker containers, then a more individualised license may be required and can be handled by your Customer or Account service Manager.

Anyone can build a docker image using the template provided and you can modify it or adjust to suit your needs. It will just involve some basic changes to suit your environment.

To Start using dockers or to get an idea of how it can be done, please download one of the 2 templates.

Template 1: Basic standalone Yellowfin instance, running on Ubuntu using OpenJDK 11 and connecting to a remote DB

Template 2: Basic clustered node Yellowfin instance, running on Alpine using JDK 8 and connecting to a remote DB

Neither of these templates are using HSQLB as their core DB connection as HSQLB is a non production Database, however if you do install the Tutorial Database a HSQLB will be used, but only for the Tutorial.

Both of these are designed to build a working Yellowfin Docker Image, for you to start a container with Yellowfin starting as the CMD.

Template 1

In this template we have used Ubuntu:latest with openJDK 11 and Yellowfin 8.0.1.

You will need to check and change the Dockerfile and file prior to building and adjust to which versions of Java or Yellowfin you need.

Template 2

In this template we have used Alpine:latest with openJDK 11 and Yellowfin 8.0.0

You will need to check and change the Dockerfile and the file prior to building and adjust to which versions of Java or Yellowfin you need.

As mentioned, these are basic templates, for which you can start with and build your own super Docker images.

Quick Hint. If you are going to build a Yellowfin Docker Image, then I highly recommend, that during the initial build phases, that you first create an Image that uses the OS of your choice, with a Java layer on top as this can be quite time consuming if you have to build a new image from scratch and install Java each time. Once happy with the way the Dockerfile is working for you and everything is working well, then perhaps go back to the official OS Docker image and use apk, apt-get, yum or whatever is required to install the latest Java version going forward.

Template 1 (Dockerfile Example)

# This Dockerfile is a basic template to allow you to build OpenJDK and Yellowfin layers onto an Ubuntu Image

# This build also requires a connection to a database to be available to the Docker container

# - Make sure that the Container can connect to the Database else the silent install will fail

# - Changes to the MUST be made to reflect your installation and Database

# - If creating a new DB, make sure it does not exist, else the silent install will fail

# ------------------------------------------------------

# Grab the latest ubuntu Repository

# ------------------------------------------------------

# Ubuntu - Official - Recommend using Official Docker Image

FROM ubuntu:latest

# Ubuntu - Official with OpenJDK installed

# FROM thorntonp72/dockerhub:ubuntu_ojdk11

# ------------------------------------------------------

# Define WORKDIR

# ------------------------------------------------------

WORKDIR /Yellowfin

# ------------------------------------------------------

# Set Some Variables

# ------------------------------------------------------

ENV JDK_VERSION=openjdk-11-jre


ENV YELLOWFIN_LATEST=yellowfin-8.0.1-20190301-full.jar


# ------------------------------------------------------

# Copy Local Files into Image

# ------------------------------------------------------

COPY license.lic license.lic


# ------------------------------------------------------

# Install and Download wget & openjdk

# ------------------------------------------------------

RUN apt update && apt-get install -y $JDK_VERSION

# ------------------------------------------------------

# Get the JAR file from Yellowfin (ADD) for from local folder (COPY)

# NOTE : Best Practices for Docker is to install wget on the image and use wget to retrieve the file

# COPY and/or ADD has been used as below to speed deployment

# ------------------------------------------------------



# ------------------------------------------------------

# Build Yellowfin using silent install (This must match your Database settings)

# ------------------------------------------------------

RUN java -jar $YELLOWFIN_LATEST -silent

# ------------------------------------------------------

# Remove Yellowfin and Licence File

# ------------------------------------------------------

RUN rm $YELLOWFIN_LATEST && rm license.lic

# ------------------------------------------------------

# Expose Tomcat port to the local host

# ------------------------------------------------------


# ------------------------------------------------------

# Define Startup CMD line when container starts

# ------------------------------------------------------

CMD ["/bin/bash","./appserver/bin/","run"]

Is article helpful?