FOR BI PROS LEARN Tableau
HOWTO: Tableau Server Linux in Docker Container
November 2, 2017
0
, , , ,

We are all excited about the great news that Tableau will release its Server version on Linux. Even if I’ve been testing the linux build for a while now, since this feature is currently in Beta I can start sharing tips and tricks that will make others’ (yours perhaps) lives easier. The first is an easy howto, namely how to run a Tableau Server Linux in Docker container. Running the production Server in docker definitely makes no sense, however, for quick and dirty checks or automated testing pipelines (CD/CI) it has it’s own place. So let’s see.

TL;DR

Dockerfile, instruction and code is here: https://github.com/tfoldi/tableau-server-beta-docker

If you prefer to watch a geeky console video, here is the flow how you can build the image with few simple commands:

After the build you can simply execute make run  to execute the built image.

Prerequisites

To start you  need a systemd based Linux host (can be physical box or VM) with Docker installed. If you don’t have this I suggest to create an amazon ec2 instance with CentOS 7. Simply provision a new image with a CentOS7 marketplace image:

You need to install docker and set the required permissions to run it with a non-root user. To do that simply create a group called docker and set your desired user’s membership to include this group. If all good, you should be able to list running docker images with docker ps :

Now we are good to go and focus on Tableau specific tasks.

Building the Dockerfile

First of all, “Dockerizing” Linux is not that easy, even folks at Tableau had problems doing that:

The good old systemd. It’s a love hate relationship: we all know that the init.d/rc.d approach is not scalable but we all do hate systemd. Let’s address this first with our Dockerfile:

As you see we start from a special systemd centos image. If your parent docker image does not support systemd, you will have  bad times.

Few important things here:

  • Line 6: We should add the cgroup  specific volumes here as external ones. Also, to speed things up /var/opt/tableau  should go to a volume.
  • Line 9: to reduce docker fs layers we install dependencies (plus vim), create the OS users and install the Tableau Server bits in the same RUN  run.
  • Line 22: my magic config file templates and init scripts go under /opt/tableau/docker_build/
  • Line 24: this is the magic part: installing tableau_server_install.service  systemd file and enable it. This systemd service will run only at the first execution and will invoke the initalization part.
  • Line 31: the start command is systemd’s init

Now we have our docker image, let’s run it.

The first run: initalizing the container

Tableau Server must be initalized before you start using it. You have to accept the EULA, register, license and initalize the server. All these actions are performed during your first load from the above mentioned tableau server install systemd service. The code to initalize the server can be found here:

And now, for you, a boring but complete screencast from this phase:

After the initalization you can see that the container reached the multi user state:

And now nothing is left but log on to the server with admin / admin user / pass:

Tableau Linux build in Docker.

And wow, Linux, fully automated installation directly in docker.

*Pro tip*

After you initalized the image and your tableau server is up and running, it’s activated and licensed it’s time to save back to your docker repository. Thus, next time when you run the image you don’t have to wait 10 mins for the initalization. However, for that you have to keep track of your volumes and make sure that you set volume storage to a persistent location.

 

Where is the code?

Again, it’s here: https://github.com/tfoldi/tableau-server-beta-docker

Questions? Comments?

Just drop a comment.

 

 

Tamás Földi

Tamás Földi

Director of IT Development at Starschema
Decades of experience with data processing and state of the art programming. From nuclear bomb explosion simulation to distributed file systems. ethical hacking, real time stream processing practically I always had a great fun with those geeky ones and zeros.
Tamás Földi

Related items

/ You may check this items as well

Tableau Consistency Checker

Tableau Filestore Consistency Checker – How Repository Maps to Filestore

We are all excited about the great news that Table...

Read more
TCOT

Pushing the Limits of Tableau Server – Practical Lessons from a Zen Master

We are all excited about the great news that Table...

Read more
Sales dashboard embedded into SAP GUI

Embed Tableau Dashboards in SAP ERP and S4/HANA

We are all excited about the great news that Table...

Read more