A few clues on creating a Jazz Docker image

Getting started with Docker

You can check these links if you need to know about Docker.

Building by example

Building your image

This example taken from the LSS shows how to build a Docker image and update it to Docker Hub.

#!/bin/bash

docker_pwd=$(pwd)

cd ../server || return 1

make jazz
cp jazz ../docker
make clean

cd "$docker_pwd" || return 1

cp ../server/config/jazz_config.ini .
cp -r ../server/config/www www

docker build -t jazz_ref_stable .
docker login

docker tag jazz_ref_stable kaalam/jazz_neat:0.5.3
docker push kaalam/jazz_neat:0.5.3

rm jazz
rm jazz_config.ini
rm -rf www

Use this to run the image you just created.

docker run -p8888:8888 kaalam/jazz_neat:0.5.3

You can use this to run the docker image in debug mode (allowing login into the Linux image).

docker run -p8888:8888 -ti kaalam/jazz_neat:0.5.3 /bin/bash

This example (implicitly) refers to a Dockerfile to tell Docker how to build the image. Note that as Jazz’s requirements have grown, the dockerfile has become longer, especially, because there is no simple apt-get installation of zeroMQ. It contains the sources of zeroMQ, install development tools, compiles it and install it.

FROM ubuntu

LABEL author=kaalam.ai

WORKDIR /home/jazz

COPY zeromq-4.3.4.tar.gz /home/jazz

RUN tar -xvf zeromq-4.3.4.tar.gz
RUN apt-get update --fix-missing
RUN apt-get install -y libmicrohttpd-dev
RUN apt-get install -y libcurl4-gnutls-dev

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get install -y g++
RUN apt-get install -y make
RUN apt-get install -y xutils-dev
RUN apt-get install -y libtool
RUN apt-get install -y automake
RUN apt-get install -y pkg-config

WORKDIR /home/jazz/zeromq-4.3.4

RUN ./autogen.sh
RUN ./configure
RUN make
RUN make install
RUN ln -s /usr/local/lib/libzmq.so.5 /usr/lib/x86_64-linux-gnu/

WORKDIR /home/jazz

RUN mkdir /home/jazz/jazz_dbg_mdb

ADD ./start.sh /home/jazz
ADD ./jazz /home/jazz
ADD ./jazz_config.ini /home/jazz/config/jazz_config.ini
ADD ./www /home/jazz/config/www/

EXPOSE 8899

CMD ["/home/jazz/start.sh"]

The start.sh file is found in the docker folder, but it’s just a call to jazz start.