Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Titan 6.4.0 Docker images published in DockerHub(Titan in Docker part 2)
Titan 6.4.0 Docker images published in DockerHub [message #1792243] Fri, 13 July 2018 07:36 Go to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 807
Registered: January 2015
Senior Member
Dear all,


for those of you who wish to play with Titan in the form of a docker image,

we have published two such images in DockerHub:

https://hub.docker.com/u/eclipsetitan/


https://hub.docker.com/r/eclipsetitan/titan-alpine/
A minimal Docker image for Eclipse Titan 6.4.0 based on Alpine Linux.

pull with:

docker pull eclipsetitan/titan-alpine:6.4.0


https://hub.docker.com/r/eclipsetitan/titan-ubuntu/
A Docker image for Eclipse Titan 6.4.0 based on Ubuntu 18.04 LTS.

pull with:

docker pull eclipsetitan/titan-ubuntu:6.4.0


The Dockerfiles used to generate these images:

FROM alpine:edge
MAINTAINER Aron Simon <aron.simon@sigmatechnology.se>

## INSTALL DEPENDENCIES
RUN apk update && \
    apk add --no-cache sudo make git g++ diffutils expect openssl-dev libxml2-dev libxml2-utils ncurses-dev flex bison perl libexecinfo-dev bash

## CREATE SUDOER USER
RUN adduser -S -D -G root -h /home/titan -s /bin/bash titan && \
    echo "titan:titan" | chpasswd && \
    echo "titan ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
USER titan

## SETUP .BASHRC TO SETUP HOSTS FILE AT THE BOOT TIME
RUN echo 'sudo sh -c "cp /etc/hosts /etc/append && (echo \"127.0.1.1  $HOSTNAME\"; cat /etc/append) > /etc/hosts"' >> /home/titan/.bashrc
RUN echo 'sh' >> /home/titan/.bashrc

## SET UP ENV VARIABLES
ENV TTCN3_DIR=/home/titan/titan.core/Install
ENV PATH=$TTCN3_DIR/bin:$PATH \
    LD_LIBRARY_PATH=$TTCN3_DIR/lib:$LD_LIBRARY_PATH

## CLONE TITAN
WORKDIR /home/titan
RUN git clone https://github.com/eclipse/titan.core.git
WORKDIR /home/titan/titan.core/
RUN git checkout tags/6.4.0

## SET FLAGS
RUN echo 'ALPINE_LINUX := yes \n\
          TTCN3_DIR := /home/titan/titan.core/Install \n\
          XMLDIR := /usr \n\
          OPENSSL_DIR := /usr \n\
          JNI := no \n\
          GEN_PDF := no' >> Makefile.personal

## BUILD TITAN
RUN make install

ENTRYPOINT /bin/bash 


and

FROM ubuntu:18.04
MAINTAINER Aron Simon <aron.simon@sigmatechnology.se>

ENV DEBIAN_FRONTEND=noninteractive

## INSTALL DEPENDENCIES
RUN apt-get update && \
    apt-get install -yq \
                    git gdb curl expect g++ make libssl-dev \
                    libxml2-dev libncurses5-dev flex bison \
                    xutils-dev ant xsltproc automake perl sudo

## CREATE SUDOER USER
RUN useradd --create-home --shell /bin/bash titan && \
    adduser --disabled-password titan sudo && \
    echo "titan ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
USER titan

## SETUP .BASHRC TO SETUP HOSTS FILE AT THE BOOT TIME 150.132.184.69
RUN echo 'sudo sh -c "cp /etc/hosts /etc/append && (echo \"127.0.1.1  $HOSTNAME\"; cat /etc/append) > /etc/hosts"' >> /home/titan/.bashrc

## SET UP ENV VARIABLES
ENV TTCN3_DIR=/home/titan/titan.core/Install
ENV PATH=$TTCN3_DIR/bin:$PATH \
    LD_LIBRARY_PATH=$TTCN3_DIR/lib:$LD_LIBRARY_PATH

## CLONE TITAN
WORKDIR /home/titan/
RUN git clone https://github.com/eclipse/titan.core.git
WORKDIR /home/titan/titan.core
RUN git checkout tags/6.4.0

## SET FLAGS
RUN echo 'TTCN3_DIR := /home/titan/titan.core/Install' >> Makefile.personal
RUN echo 'XMLDIR := /usr' >> Makefile.personal
RUN echo 'OPENSSL_DIR := /usr' >> Makefile.personal
RUN echo 'JNI := no' >> Makefile.personal
RUN echo 'GEN_PDF := no' >> Makefile.personal

## BUILD TITAN
RUN make install 



For some other examples of Dockerfiles , please see :

Titan in Docker part 1
https://www.eclipse.org/forums/index.php/t/1091625/


Looking forward to your feedback

Best regards
Elemer

[Updated on: Fri, 13 July 2018 16:29]

Report message to a moderator

Re: Titan 6.4.0 Docker images published in DockerHub [message #1792537 is a reply to message #1792243] Thu, 19 July 2018 09:00 Go to previous message
Aron Simon is currently offline Aron SimonFriend
Messages: 1
Registered: July 2018
Junior Member
Dear all,


As time passes, we acquire more experience with the Titan images published and we update them regularly;
hence we recommend pulling them again from time to time, as we will indicate in this forum.

Although the interactive mode of the images works perfectly, there might be some glitches in the non-interactive one;
on Tuesday I tried to use the published Titan images in non-interactive mode, as below:

docker run eclipsetitan/titan-alpine ls


The created container executed without the expected logs. I tried to fix it as soon as possible as the non-interactive mode is the basis of the automated builds.

The reason of the problem is a conflict between the Docker CMD and our personalized bash initial mechanism, which we tried to fix the hosts file with:
## SETUP .BASHRC TO SETUP HOSTS FILE AT THE BOOT TIME
RUN echo 'sudo sh -c "cp /etc/hosts /etc/append && (echo \"127.0.1.1  $HOSTNAME\"; cat /etc/append) > /etc/hosts"' >> /home/titan/.bashrc

...

ENTRYPOINT /bin/bash


We gave up this modification for now, so the non-interactive mode is working again.

Without this fix, the following feature is not working yet in TTCN3 (create component explicitly in "localhost"):

var MyComponentType myNewComponent := MyComponentType.create("My component name", "localhost")


The relevant test is here.

An example of how to run the Titan demo-project in Docker using non-interactive mode:
docker run eclipsetitan/titan-alpine sh -c 'cd TTCN3_DIR/demo && make && ttcn3_start MyExample MyExample.cfg'


The simplified Dockerfile for titan-alpine:
FROM alpine:edge
MAINTAINER Aron Simon <aron.simon@sigmatechnology.se>

## INSTALL DEPENDENCIES
RUN apk update && \
    apk add --no-cache \
        sudo make git g++ diffutils expect openssl-dev \
        libxml2-dev libxml2-utils ncurses-dev flex bison \
        perl libexecinfo-dev bash

## CREATE SUDOER USER
RUN adduser -S -D -G root -h /home/titan titan && \
    echo "titan:titan" | chpasswd && \
    echo "titan ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
USER titan

## SET UP ENV VARIABLES
ENV TTCN3_DIR=/home/titan/titan.core/Install
ENV PATH=$TTCN3_DIR/bin:$PATH \
    LD_LIBRARY_PATH=$TTCN3_DIR/lib:$LD_LIBRARY_PATH

## CLONE TITAN
WORKDIR /home/titan
RUN git clone https://github.com/eclipse/titan.core.git
# Checkout release 6.4.0
WORKDIR /home/titan/titan.core/
RUN git checkout tags/6.4.0

## SET Makefile.personal
# ALPINE_LINUX := yes
# TTCN3_DIR := /home/titan/titan.core/Install
# XMLDIR := /usr
# OPENSSL_DIR := /usr
# JNI := no
# GEN_PDF := no
COPY Makefile.personal-alpine Makefile.personal

## BUILD TITAN
RUN make install

WORKDIR /home/titan
CMD compiler -v && /bin/sh


The simplified Dockerfile for titan-ubuntu:
FROM ubuntu:18.04
MAINTAINER Aron Simon <aron.simon@sigmatechnology.se>

ENV DEBIAN_FRONTEND=noninteractive

## INSTALL DEPENDENCIES
RUN apt-get update && \
    apt-get install -yq \
                    git gdb curl expect g++ make libssl-dev \
                    libxml2-dev libncurses5-dev flex bison \
                    xutils-dev ant xsltproc automake perl sudo

## CREATE SUDOER USER
RUN useradd --create-home --shell /bin/bash titan && \
    adduser --disabled-password titan sudo && \
    echo "titan ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
USER titan

## SET UP ENV VARIABLES
ENV TTCN3_DIR=/home/titan/titan.core/Install
ENV PATH=$TTCN3_DIR/bin:$PATH \
    LD_LIBRARY_PATH=$TTCN3_DIR/lib:$LD_LIBRARY_PATH

## CLONE TITAN
WORKDIR /home/titan/
RUN git clone https://github.com/eclipse/titan.core.git
# Checkout release 6.4.0
WORKDIR /home/titan/titan.core
RUN git checkout tags/6.4.0

## SET Makefile.personal
# TTCN3_DIR := /home/titan/titan.core/Install
# XMLDIR := /usr
# OPENSSL_DIR := /usr
# JNI := no
# GEN_PDF := no
COPY Makefile.personal-ubuntu Makefile.personal

## BUILD TITAN
RUN make install

WORKDIR /home/titan
CMD compiler -v && /bin/bash


Looking forward to your feedback

Best regards,
Aron
Previous Topic:Problem with duplicate incoming message type boolean
Next Topic:Test Performance in TITAN using Timestamps
Goto Forum:
  


Current Time: Fri Sep 21 14:14:38 GMT 2018

Powered by FUDForum. Page generated in 0.03569 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top