Titan in Docker part 1 [message #1781606] |
Fri, 09 February 2018 10:47 |
|
Titan in Docker part I
Dear all,
there have been voices from the crowd requesting a Titan release in Docker.
There are a number of reasons why we don't release Docker images with Titan installed inside:
-these images are quite large (we are talking Gigabytes)
-if we produce such images, these require , besides building, time and resources for testing them
-installing Titan , at least the core , is a matter of a couple of minutes even from source; the pre-compiled binaries only need to be downloaded and unpacked
(or if you have later Ubuntu/Debian versions, Titan can be installed from package ), so distributing it in Docker images
would not be a great time saving
However we understand the advantages of having a Docker image containing Titan so we will try to help you by publishing
Dockerfiles that can be used to produce such images.
The Dockerfiles ( simple text files really, akin to shell scripts ) contain a recipe which is read by Docker and used to cook for you a Docker image.
They can be used "as is" or tailored (using a magic trick known as 'editing' ) to your wishes and environment.
There are a number of variables that can be controlled by editing the Dockerfiles: the Linux distro , the gcc and Titan version etc.
The below Dockerfile for instance will create an Ubuntu 16.04 LTS image with Titan 6.3.0 installed from the published binaries.
## TITAN Dockerfile (Ubuntu 16.04)
FROM ubuntu:16.04
MAINTAINER Gergely Pilisi
LABEL description="Eclipse Titan Docker Image"
## ENVIRONMENT
ENV TERM=linux
ENV HOSTNAME eclipse-titan
## PREPARE THE SYSTEM
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y git build-essential flex bison expect default-jdk libssl-dev libxml2-dev libncurses5-dev wget
## ADD TITAN USER
RUN useradd --create-home --shell /bin/bash titan
RUN echo "titan:titan" | chpasswd
RUN adduser titan sudo
RUN mkdir -p /home/titan/ttcn3-6.3.pl0
## GET TITAN
WORKDIR /home/titan/ttcn3-6.3.pl0
RUN wget -O ttcn3-6.3.pl0-linux64-gcc5.4-ubuntu16.04.tgz https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-6.3.pl0-linux64-gcc5.4-ubuntu16.04.tgz\&r=1
RUN tar -xvzf ttcn3-6.3.pl0-linux64-gcc5.4-ubuntu16.04.tgz
RUN rm -f ttcn3-6.3.pl0-linux64-gcc5.4-ubuntu16.04.tgz
## SET ENVIRONMENTAL VARIABLES
ENV TTCN3_DIR=/home/titan/ttcn3-6.3.pl0
ENV PATH=$TTCN3_DIR/bin:$PATH
ENV LD_LIBRARY_PATH=$TTCN3_DIR/lib:$LD_LIBRARY_PATH
## CHECK TITAN
RUN compiler -v
CMD ["/bin/bash"]
USER titan
WORKDIR /home/titan
Please be aware that the content of this Dockerfile may go stale as, when binaries for the next release will be published ,
6.3.0 binaries may ( and likely will ) become unavailable.
The next example will create a Ubuntu 16.04 LTS image with Titan installed from the latest source available in github:
FROM ubuntu:16.04
MAINTAINER Gergely Pilisi
LABEL description="Eclipse Titan Docker Image"
## ENVIRONMENT
ENV TERM=linux
ENV HOSTNAME eclipse-titan
## PREPARE THE SYSTEM
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y git build-essential flex bison expect default-jdk libssl-dev libxml2-dev libncurses5-dev
## ADD TITAN USER
RUN useradd --create-home --shell /bin/bash titan
RUN echo "titan:titan" | chpasswd
RUN adduser titan sudo
## CLONE TITAN INTO /home/titan.core
WORKDIR /home/titan
RUN git clone https://github.com/eclipse/titan.core.git
## BUILD TITAN
WORKDIR /home/titan/titan.core
RUN make install
## SET ENVIRONMENTAL VARIABLESS
ENV TTCN3_DIR=/home/titan/titan.core/Install
ENV PATH=$TTCN3_DIR/bin:$PATH
ENV LD_LIBRARY_PATH=$TTCN3_DIR/lib:$LD_LIBRARY_PATH
## CHECK TITAN
RUN compiler -v
CMD ["/bin/bash"]
USER titan
WORKDIR /home/titan
Instead of the latest source one may clone a tagged git release;
Tags are listed here:
https://github.com/eclipse/titan.core/releases
The created image will have the below characteristics:
titan@eclipse-titan:~$ uname -a
Linux eclipse-titan 3.13.0-141-generic #190-Ubuntu SMP Fri Jan 19 12:52:38 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"
titan@eclipse-titan:~$ whoami
titan
titan@eclipse-titan:~$ openssl version
OpenSSL 1.0.2g 1 Mar 2016
titan@eclipse-titan:~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.6' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.6)
titan@eclipse-titan:~$ which compiler
/home/titan/titan.core/Install/bin/compiler
titan@eclipse-titan:~$ compiler -v
TTCN-3 and ASN.1 Compiler for the TTCN-3 Test Executor
Product number: CRL 113 200/6 R3B
Build date: Feb 7 2018 15:23:13
Compiled with: GCC 5.4.0
Using OpenSSL 1.0.2g 1 Mar 2016
Copyright (c) 2000-2017 Ericsson Telecom AB
To be continued
Best regards
Elemer
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02592 seconds