Hub Server in a Container#

Cegal Hub Server can be run in a container. This supports deployments with Docker and Kubernetes.

This guide will demonstrate how to build a docker image for Cegal Hub Server and then run a container. It is assumed that Docker is installed locally.

System requirements#

Ubuntu, Debian and CentOS base images have been verified as suitable base images for Hub Server.

Sample dockerfile#

Below is an example of a dockerfile based off a CentOS base image.

It is assumed that when building the image the cegalhub linux binary is available together with the Dockerfile and shell script shown below.

FROM centos as deploy

WORKDIR /app
ADD cegalhub /app/
ADD start.sh /app/

ENV TLS=false
ENV PORT=9595
ENV CERT_FILE_PATH=
ENV KEY_FILE_PATH=
ENV KEYSTONE_TENANT_ID=

CMD ["sh","./start.sh"]

The shell script (start.sh) referenced in the Dockerfile is shown below.

#!/bin/bash
./cegalhub server \
--port=${PORT} \
--tls=${TLS} \
--cert=${CERT_FILE_PATH} \
--key=${KEY_FILE_PATH} \
--ksid=${KEYSTONE_TENANT_ID} \

To build the image ensure the start.sh file and cegalhub linux binary together with Dockerfile are in a folder.

docker build -t myhubserver .

To run the container in docker locally type the below

docker run -it -e TLS=false myhubserver