Description

GenRocket provides a Docker image you can download and use for a containerized environment. However, you can also create a custom Docker image with the help of the Docker template provided in this article.


Once finished, you can click here for the steps needed to finish the Docker setup. Remember to install GenRocket Runtime as well!

Docker Template

A Docker file can be created with the following content:

FROM openjdk:8-slim

WORKDIR /opt/Genrocket
#ARG ORGANIZATION_ID
#ARG GR_RUNTIME_VRSION=3.5.27
RUN mkdir -p /opt/Genrocket; \
   cd /opt/Genrocket; \
   export GEN_ROCKET_HOME=/opt/Genrocket/genrocket; \
   export PATH="${GEN_ROCKET_HOME}/bin:${PATH}"; \
   apt-get update; apt-get install -y wget curl unzip libfontconfig1; \
   rm -rf /var/lib/apt/lists/*; \
   wget https://app.genrocket.com/rest/download/runtime/<orgExternalID> -O /opt/genrocket.zip
ENV GEN_ROCKET_HOME=/opt/Genrocket/genrocket
ENV PATH="/opt/Genrocket/genrocket/bin:${PATH}"
COPY docker-entrypoint /opt/
RUN chmod 755 /opt/docker-entrypoint
ENTRYPOINT ["/opt/docker-entrypoint"]
CMD ["bash"]


The <orgExternalID> can be obtained from the My Organization page in the GenRocket web platform.




docker-entrypoint file

The above script is dependent on the docker-entrypoint file. The content of the docker-entrypoint file is shown below:

#!/bin/bash
export GEN_ROCKET_HOME="/opt/Genrocket/genrocket"
if [[ ! -d "$GEN_ROCKET_HOME" ]]; then
echo "GenRocket HOME directory does not exist in the mounted HostSystemPath"
cd /opt/Genrocket

unzip /opt/genrocket.zip -d /opt/Genrocket
for gr in $(ls -d */); do mv ${gr%%/} genrocket; done
rm -rf genrocket.zip
mkdir -p /opt/Genrocket/scenarios
mkdir -p /opt/Genrocket/outputs
else
echo "GenRocket HOME directory already exists"
fi
if [[ "$GR_UPDATE" == "true" ]]; then
echo "Updating the genRocket runtime environment using genrocket -a command"
genrocket -a
fi
exec $@