Commit 6cab0a75 authored by Yann Garcia's avatar Yann Garcia
Browse files

Enhance docker

parent c7cb5fce
Loading
Loading
Loading
Loading
+2 −7
Original line number Original line Diff line number Diff line
@@ -10,11 +10,6 @@ cd $(dirname $0)
run_dir=`pwd`
run_dir=`pwd`


# Docker version 2
# Docker version 2
#cd docker/v2
#./build.sh
#./run.sh

# Docker version 1
cd docker
cd docker
./build-container.sh
./build.sh
./run-container.sh $run_dir
#./run.sh
+12 −110
Original line number Original line Diff line number Diff line
FROM ubuntu:18.04
FROM stfubuntu:18.04


MAINTAINER ETSI STF 525
MAINTAINER ETSI TTF T0002


LABEL description="TTF0002 Docker Image"
LABEL description="TTF0002 Docker Image"


ENV TERM=linux
ENV TERM=linux \
ENV HOSTNAME docker-titan-TTF0002
    HOME=/home/etsi \
    HOSTNAME=docker-titan-TTF0002


ARG ssh_pub_key
COPY home /home/etsi


RUN echo "docker-titan-TTF0002" > /etc/hostname \
RUN cd /home/etsi \
    && DEBIAN_FRONTEND=noninteractive apt-get update \
    && chown -R etsi:etsi . \
    && DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y \
    && ls ./etc/init.d/*.sh | while read S; do chmod 0750 "$S" || exit 1; done
    && DEBIAN_FRONTEND=noninteractive apt-get install software-properties-common -y \
    && DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:linuxuprising/java -y \
    && DEBIAN_FRONTEND=noninteractive apt-get update \
    && DEBIAN_FRONTEND=noninteractive apt-get --allow-unauthenticated install -y \
      autoconf \
      bison \
      build-essential \
      cmake \
      curl \
      dos2unix \
      doxygen \
      emacs \
      expect \
      flex \
      g++-8 \
      gcc-8 \
      gdb \
      git-core \
      gnutls-bin \
      graphviz \
      libglib2.0-dev \
      libpcap-dev \
      libgcrypt-dev \
      libncurses5-dev \
      libssl-dev \
      libtool-bin \
      libtool \
      libwebsockets-dev \
      libwireshark-dev \
      libxml2-dev \
      lsof \
      ntp \
      openssh-server \
      pkg-config \
      qt5-default \
      qttools5-dev \
      qtmultimedia5-dev \
      libqt5svg5-dev \
      subversion \
      sudo \
      sshpass \
      tcpdump \
      texlive-font-utils \
      tshark \
      tzdata \
      valgrind \
      vim \
      vsftpd \
      xutils-dev \ 
      tree \
      unzip \
      wget \
      xsltproc \
    && DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y \
    && DEBIAN_FRONTEND=noninteractive apt-get autoclean \
    && useradd --create-home --shell /bin/bash --user-group etsi --groups sudo \
    && echo "etsi:etsi" | chpasswd \
    && adduser etsi sudo \
    && cd /home/etsi \
    && echo "" >> /home/etsi/.bashrc \
    && echo "export HOME=/home/etsi" >> /home/etsi/.bashrc \
    && echo "export LD_LIBRARY_PATH=/home/etsi/dev/etsi_its/lib:$LD_LIBRARY_PATH" >> /home/etsi/.bashrc \
    && echo "export PATH=/home/etsi/bin:$PATH" >> /home/etsi/.bashrc \
    && echo "cd /home/etsi" >> /home/etsi/.bashrc \
    && echo ". ./devenv.bash" >> /home/etsi/.bashrc \
    && . /home/etsi/.bashrc \
    && mkdir -p bin lib include tmp frameworks docs man dev \
    && chown etsi:etsi bin lib include tmp frameworks docs man dev \
    && echo "etsi ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers


USER etsi
USER etsi


RUN cd /home/etsi/dev \
RUN cd ${HOME} \
    && git clone -b TTF0002 --recurse-submodules https://forge.etsi.org/gitlab/ITS/ITS.git ./TTF0002_Its \
    && export PATH=$HOME/bin:$PATH \
    && cd /home/etsi/dev/TTF0002_Its/ttcn/LibIts \
    && ls ${HOME}/etc/init.d/*.sh | while read S; do /bin/bash -c "$S" || exit 1; done
    && git checkout TTF0002 \
    && cd /home/etsi/dev/TTF0002_Its/scripts \
    && chmod 775 *.bash devenv.bash.* \
    && ./update_user_name.sh \
    && cd /home/etsi \
    && ln -sf /home/etsi/dev/TTF0002_Its/scripts/devenv.bash.ubuntu /home/etsi/devenv.bash \
    && ls -ltr /home/etsi \
    && export HOME=/home/etsi \
    && cd /home/etsi/frameworks \
    && git clone https://github.com/vlm/asn1c.git asn1c \
    && cd asn1c \
    && test -f configure || autoreconf -iv \
    && ./configure \
    && make && sudo make install \
    && cd /home/etsi/frameworks \
    && wget -q 'http://ftp.halifax.rwth-aachen.de/eclipse/technology/epp/downloads/release/photon/R/eclipse-cpp-photon-R-linux-gtk-x86_64.tar.gz' \
    && tar -zxvf ./eclipse-cpp-photon-R-linux-gtk-x86_64.tar.gz \
    && rm -f ./eclipse-cpp-photon-R-linux-gtk-x86_64.tar.gz \
    && . /home/etsi/devenv.bash \
    && cd /home/etsi/dev/TTF0002_Its/scripts \
    && ./build_titan.bash \
    && . /home/etsi/devenv.bash \
    && cp /home/etsi/dev/TTF0002_Its/data/v3/asn1c_cert.tar.bz2 /home/etsi/tmp \
    && cd /home/etsi/tmp \
    && tar xvjf ./asn1c_cert.tar.bz2 \
    && cd /home/etsi/dev/TTF0002_Its/scripts \
    && ./update_its_project.bash \
    && cd ${HOME}/dev/etsi_its/src/AtsPki/objs \
    && ../bin/pki_generate_makefile.bash \
    && ../bin/run_all.bash 


CMD ["/bin/bash"]
CMD ["/bin/bash"]


+25 −10
Original line number Original line Diff line number Diff line
@@ -13,7 +13,7 @@ RUN echo "docker-STF-dev" > /etc/hostname \
    && DEBIAN_FRONTEND=noninteractive apt-get install software-properties-common -y \
    && DEBIAN_FRONTEND=noninteractive apt-get install software-properties-common -y \
    && DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:linuxuprising/java -y \
    && DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:linuxuprising/java -y \
    && DEBIAN_FRONTEND=noninteractive apt-get update \
    && DEBIAN_FRONTEND=noninteractive apt-get update \
    && ( echo "oracle-java10-installer shared/accepted-oracle-license-v1-1 boolean true" | debconf-set-selections -v ) \
    && ( echo "oracle-java14-installer shared/accepted-oracle-license-v1-2 boolean true" | debconf-set-selections -v ) \
    && DEBIAN_FRONTEND=noninteractive apt-get --allow-unauthenticated install -y \
    && DEBIAN_FRONTEND=noninteractive apt-get --allow-unauthenticated install -y \
      autoconf \
      autoconf \
      bison \
      bison \
@@ -31,21 +31,32 @@ RUN echo "docker-STF-dev" > /etc/hostname \
      git-core \
      git-core \
      gnutls-bin \
      gnutls-bin \
      graphviz \
      graphviz \
      iputils-ping \
      libffi-dev \
      libglib2.0-dev \
      libglib2.0-dev \
      libpcap-dev \
      libgcrypt-dev \
      libgcrypt-dev \
      libncurses5-dev \
      libncurses5-dev \
      libpcap-dev \
      libqt5svg5-dev \
      libssl-dev \
      libssl-dev \
      libtool-bin \
      libtool-bin \
      libtool \
      libtool \
      libwireshark-dev \
      libwireshark-dev \
      libxml2-dev \
      libxml2-dev \
      libxml2-utils \
      libyaml-dev \
      lsof \
      lsof \
      net-tools \
      ntp \
      ntp \
      oracle-java14-installer \
      oracle-java14-set-default \
      openssh-server \
      pkg-config \
      pkg-config \
      python3-dev \
      python3-pip \
      python3-setuptools \
      qt5-default \
      qt5-default \
      qtmultimedia5-dev \
      qtmultimedia5-dev \
      libqt5svg5-dev \
      subversion \
      subversion \
      sudo \
      sudo \
      sshpass \
      sshpass \
@@ -61,13 +72,9 @@ RUN echo "docker-STF-dev" > /etc/hostname \
      unzip \
      unzip \
      wget \
      wget \
      xsltproc \
      xsltproc \
      oracle-java10-installer \
      oracle-java10-set-default \
      libxml2-utils \
      net-tools \
      iputils-ping \
    && DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y \
    && DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y \
    && DEBIAN_FRONTEND=noninteractive apt-get autoclean \
    && DEBIAN_FRONTEND=noninteractive apt-get autoclean \
    && pip3 install --upgrade setuptools pip \
    && useradd --create-home --shell /bin/bash etsi \
    && useradd --create-home --shell /bin/bash etsi \
    && echo "etsi:etsi" | chpasswd \
    && echo "etsi:etsi" | chpasswd \
    && adduser etsi sudo \
    && adduser etsi sudo \
@@ -78,9 +85,17 @@ RUN echo "docker-STF-dev" > /etc/hostname \
    && echo 'cd ${HOME}' >> /etc/profile \
    && echo 'cd ${HOME}' >> /etc/profile \
    && echo ". ./devenv.bash" >> /etc/profile \
    && echo ". ./devenv.bash" >> /etc/profile \
    && cd /home/etsi \
    && cd /home/etsi \
    && mkdir -p bin lib include tmp frameworks docs man dev src \
    && echo "" >> ./.profile \
    && echo 'export HOME=/home/etsi' >> ./.profile \
    && echo 'export LD_LIBRARY_PATH=${HOME}/lib:$LD_LIBRARY_PATH' >> ./.profile \
    && echo 'export PATH=${HOME}/bin:$PATH' >> ./.profile \
    && echo 'cd ${HOME}' >> ./.profile \
    && echo ". ./devenv.bash" >> ./.profile \
    && mkdir -p bin lib include tmp frameworks docs man dev \
    && chown -R etsi:etsi *
    && chown -R etsi:etsi *


EXPOSE 22

CMD ["/bin/bash"]
CMD ["/bin/bash"]


# That's all Floks
# That's all Floks
+0 −0

File moved.File mode changed from 100755 to 100644.

docker/build-container.sh

deleted100755 → 0
+0 −29
Original line number Original line Diff line number Diff line
#!/bin/bash
# Copyright ETSI 2018
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt

#set -e
set -vx

DOCKER_FILE=./Dockerfile
if [ -f ${DOCKER_FILE} ]
then
    docker build --no-cache --tag stf525_its --force-rm .
    if [ "$?" != "0" ]
    then
        echo "Docker build failed: $?"
        exit -1
    fi
    docker image ls -a
    docker inspect stf525_its:latest
    if [ "$?" != "0" ]
    then
        echo "Docker inspect failed: $?"
        exit -1
    fi
else
    exit -2
fi

# That's all Floks
exit 0
Loading