Skip to content

Continuous Integration (CI)

1138-4EB edited this page May 10, 2015 · 1 revision

Propietary applications inside a docker container

Precision inside fedora:latest

Install

docker run --name mgps -it \
           -v $(pwd):/work:z \
           -v /tmp/.X11-unix/:/tmp/.X11-unix \
           -e DISPLAY=unix$DISPLAY \
           fedora:latest bash -c "dnf update -y && dnf install -y java*openjdk && /work/Precision-linux64-2015.2.bin"

Follow the steps in the installation GUI and select /opt/ as the target path. When finished:

docker cp mgps:/opt/ tmpdir/tmpopt
docker rm mgps

Reorder content as desired, and add the following Dockerfile to tmpdir:

FROM fedora:latest

WORKDIR /work

COPY /tmpopt/ /opt/

RUN dnf install -y redhat-lsb libX11 libXft \
  && printf '#!/bin/bash\neval "/opt/PS2015.2.10/bin/${1} ${@:2}"\n' > /usr/bin/pspath \
  && chmod +x /usr/bin/pspath \
  && echo '/opt/PS2015.2.10/bin/lmgrd -c /opt/<mg.lic> -l /opt/log.log && sleep 3s && cat /opt/log.log' > /etc/profile.d/init_lmgrd.sh'

ENV LM_LICENSE_FILE="<port@myhost>"

where <mg.lic> is the license file you obtained from the vendor, and <port@myhost> must match the settings in that file.

Last, from tmpdir, run:

docker build -t <myimage> .

Run

docker run --rm -it \
           -v /tmp/.X11-unix/:/tmp/.X11-unix \
           -e DISPLAY=unix$DISPLAY \
           -h "<myhost>" \
           --mac-address="<mymac>"
           <myimage>

where <myhost>, <mymac> and <myimage> must match the values used when installing.

ModelSim/QuestaSim inside fedora:latest

The same steps as for Precision should be followed. However, ModelSim/QuestaSim might not behave as expected with versions of freetype newer than 2.4.12. Therefore, it is recommended to install that version, by prepending the following line to the install call:

 dnf install -y make gcc wget && wget --content-disposition https://sourceforge.net/projects/freetype/files/freetype2/2.4.12/freetype-2.4.12.tar.gz/download -O - | tar -xz && cd freetype-2.4.12 && ./configure --prefix=/opt/MentorGraphics/freetype --exec-prefix=/opt/MentorGraphics/freetype && make && make install && export LD_LIBRARY_PATH=/opt/MentorGraphics/freetype/lib/ &&

UI for management and visualization

  • portainer: the easiest way to manage Docker; is an open-source lightweight management UI which allows you to easily manage your Docker host or Swarm cluster.
  • dockviz: takes Docker image and container information and presents in different ways, to help you understand what's going on inside the system

Lightweight hosts to run docker containers

Orchestration