Creating the Dockerfile

A Dockerfile contains plain text instructions on how to build a docker image.

  1. Create a directory cssim to the appropriate location and change the directory to cssim.

›_ Console

# mkdir ~/cssim 

# cd ~/cssim 
  1. Create a new file Dockerfile to build our simulator image.

›_ Console

# vi Dockerfile 
  1. Copy the following lines into the Dockerfile.

For Redhat UBI Based Docker Image:

Dockerfile

FROM redhat/ubi8:latest  
LABEL version="4.60.0.0"  
maintainer = "support@utimaco.com"  
ARG SimulatorPort=3001  
RUN dnf install glibc.i686 glibc-devel.i686 libstdc++-devel.i686 -y  
WORKDIR /simulator/bin  
COPY sim5_linux /simulator  
RUN chmod u+x ./bl_sim5  
ENV SDK_PORT=$SimulatorPort  
EXPOSE $SimulatorPort  
STOPSIGNAL SIGINT  
ENTRYPOINT ["./bl_sim5"]  
CMD ["-o","-h"]

For Debian Based Docker Image:

Dockerfile

FROM debian:latest  
LABEL version="4.60.0.0"  
maintainer = "support@utimaco.com"  
ARG SimulatorPort=3001  
RUN apt-get update; \  
apt-get install -y gcc-multilib  
WORKDIR /simulator/bin  
COPY sim5_linux /simulator  
RUN chmod u+x ./bl_sim5  
ENV SDK_PORT=$SimulatorPort  
EXPOSE $SimulatorPort  
STOPSIGNAL SIGINT  
ENTRYPOINT ["./bl_sim5"]  
CMD ["-o","-h"]

Change the SecurityServer Simulator version="4.60.0.0" appropriately.

As you can see from redhat/ubi8:latest that we have derived our image from an official redhat for ubi8 image. Those images are specifically built for containers as they do not contain unnecessary files. Due to the SecurityServer Simulator being an x86 application you need to install some x86 libraries. Similar is the case for Debian image. To connect to the SecurityServer Simulator we will expose a TCP/IP port. The default port 3001 can be changed by supplying a parameter during the build process of our image. The Dockerfile moreover requires the SecurityServer Simulator files to be present in the project directory.

  1. Copy the SecurityServer Simulator files from your product CD. They are located in <cd>/Software/Linux/Simulator. Copy the sim5_linux folder to the project folder ~/cssim.

›_ Console

# cp -r /media/cdrom/Software/Linux/Simulator/sim5_linux ~/cssim 
  1. After this initial setup your project folder should look like this below.

›_ Console

# tree 
image-3285778802-1.jpg

Tree command output