Commit 5991dbf4 authored by YannGarcia's avatar YannGarcia
Browse files

Update Docker support

parent d6213c26
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
#!/bin/bash
# Copyright ETSI 2018
# Copyright ETSI 2018-2021
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt

#set -vx
set -e
set -vx
#set -e

cd "$(dirname "$0")"
cd $(dirname $0)

run_dir="$(pwd)"
run_dir=`pwd`

./docker/build-container.sh
./docker/run-container.sh "${run_dir}"
# Docker version 2
cd docker
./build.sh --force-stfubuntu
#./run.sh
+1 −1
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
	<name>STF549_ng112</name>
	<name>Ng112</name>
	<comment></comment>
	<projects>
		<project>Abstract_Socket_CNL113384</project>

certs/gen_rsa.sh

0 → 100755
+60 −0
Original line number Diff line number Diff line
#!/bin/bash
set -e
set -vx

echo " Set environment"
export dir=./out
export cadir=./out/ca
export format=pem

if ! [ -d $dir ]
then
    mkdir $dir
    mkdir -p $dir/certs $dir/crl $dir/csr $dir/newcerts $dir/privates $dir/serials $dir/publics $dir/trusted
fi

echo "--------------------------------------------------------------------------------------"
echo " Generate Test System Signing Certificate"

# For OCSP support use uncomment these:
ocspurl=ocsp.www.fscom.fr
export ocspIAI="OCSP;URI:http://$ocspurl"

countryName="/C=FR"
stateOrProvinceName="/ST=AM"
localityName="/L=Sophia-Antipolis"
organizationName="/O=ETSI"
organizationalUnitName="/OU=Plugtests"
commonName="/CN=plugtests.net"
DN=$countryName$stateOrProvinceName$localityName
DN=$DN$organizationName$organizationalUnitName$commonName
echo $DN
ConfTestID=plugtestsit
echo $ConfTestID > $dir/privates/ConfTestID_rsa.txt
sleep 1
cse_fqdn=etsi.org
emailaddr=${ConfTestID}@${cse_fqdn}
export subjectAltName="email:$emailaddr"
echo $subjectAltName

echo " Generate serial number"
openssl rand -hex $sn > $dir/serials/${ConfTestID}_server_rsa.srl
echo " Generate private Key"
openssl genrsa -out $dir/privates/${ConfTestID}_server_rsa.key.$format $key_size
echo " View key"
openssl rsa -inform $format -in $dir/privates/${ConfTestID}_server_rsa.key.$format -text -noout
#chmod 400 $dir/privates/${ConfTestID}_server_rsa.$format
echo " Create the CSR for Server Certificate file"
openssl req -config ./ca_intermediate_rsa.cfg -key $dir/privates/${ConfTestID}_server_rsa.key.$format -subj "$DN" -new -sha256 -out $dir/csr/${ConfTestID}_server_rsa.csr.$format
openssl req -text -noout -verify -in $dir/csr/${ConfTestID}_server_rsa.csr.$format
echo " Create Server Certificate file"
cp $dir/serials/${ConfTestID}_server_rsa.srl $dir/serial # hex 8 is minimum, 19 is maximum
# Note 'openssl ca' does not support DER format
openssl x509 -req -sha256 -days 375 -extensions server_cert -CA PCA-root-ca-cert.ccc -in $dir/csr/${ConfTestID}_server_rsa.csr.$format -out $dir/certs/${ConfTestID}_server_rsa.cert.$format
#chmod 444 $dir/certs/${ConfTestID}_server_rsa.cert.$format
echo " View Server Certificate"
openssl x509 -noout -text -in $dir/certs/${ConfTestID}_server_rsa.cert.$format
echo " Verify Server Certificate"
openssl verify -CAfile PCA-root-ca-cert.ccc $dir/certs/${ConfTestID}_server_rsa.cert.$format
echo " Extract public key"
openssl x509 -in $dir/certs/${ConfTestID}_server_rsa.cert.$format -pubkey -out $dir/publics/${ConfTestID}_server_rsa.pub.$format
+16 −121
Original line number Diff line number Diff line
FROM ubuntu:18.04
FROM stfubuntu:18.04

MAINTAINER ETSI STF 549
MAINTAINER ETSI NG112

LABEL description="STF549 Docker Image"
LABEL description="ETSI NG112 Docker Image"

ENV TERM=xterm
ENV HOSTNAME docker-titan-STF549
ENV TERM=linux \
    HOME=/home/etsi \
    HOSTNAME=docker-etsi-ng112

RUN DEBIAN_FRONTEND=noninteractive apt-get update \
    && DEBIAN_FRONTEND=noninteractive apt-get install software-properties-common -y \
    && DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:linuxuprising/java -y

RUN 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 \
      inetutils-ping \
      libglib2.0-dev \
      libpcap-dev \
      libgcrypt-dev \
      libncurses5-dev \
      libssl-dev \
      libtool-bin \
      libtool \
      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 \
    && rm -rf /var/lib/apt/lists/*

RUN echo "docker-titan-STF549" > /etc/hostname \
    && echo "root:etsi" | chpasswd

RUN useradd --create-home --shell /bin/bash --user-group etsi --groups sudo \
    && echo "etsi:etsi" | chpasswd \
    && adduser etsi sudo
COPY home /home/etsi

RUN cd /home/etsi \
    && echo "" >> /home/etsi/.bashrc \
    && echo "export HOME=/home/etsi" >> /home/etsi/.bashrc \
    && echo "export LD_LIBRARY_PATH=/home/etsi/dev/etsi_emcom/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

# Seems that COPY does not work as expected, to be investaged
#==> Fallback to more secured solution
#COPY [^.]* /home/etsi/dev/STF549_Ng112/
#COPY home home/etsi
RUN git clone https://forge.etsi.org/gitlab/emergency-communications/NG112.git /home/etsi/dev/STF549_Ng112
RUN chown -R etsi /home/etsi/dev/STF549_Ng112/ && cd /home/etsi/dev/STF549_Ng112
    && chown -R etsi:etsi . \
    && ls ./etc/init.d/*.sh | while read S; do chmod 0750 "$S" || exit 1; done

USER etsi

RUN cd /home/etsi/frameworks \
    && git clone https://git.savannah.gnu.org/git/osip.git ./osip \
    && cd osip \
    && ./autogen.sh \
    && ./configure --prefix=/home/etsi \
    && make && make install
RUN cd ${HOME} \
    && export PATH=$HOME/bin:$PATH \
    && ls ${HOME}/etc/init.d/*.sh | while read S; do /bin/bash -c "$S" || exit 1; done \
    && rm -fr ${HOME}/etc

RUN 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 \
    && cd /home/etsi/dev/STF549_Ng112 \
    && cd /home/etsi/dev/STF549_Ng112/ttcn \
    && git clone https://forge.etsi.org/gitlab/LIBS/LibSip.git ./LibSip \
    && git clone https://forge.etsi.org/gitlab/LIBS/LibIms.git ./LibIms \
    && git clone https://forge.etsi.org/gitlab/LIBS/LibCommon.git ./LibCommon \
    && git clone -bTTF0002 https://forge.etsi.org/gitlab/LIBS/LibIts ./LibIts \
    && cd /home/etsi/dev/STF549_Ng112/ttcn/LibIts \
    && rm -fr asn1 t3q xsd \
    && cd ttcn && rm -fr BTP CALM CAM Common DCC DENM GeoNetworking Ipv6OverGeoNetworking IVIM MapemSpatem Pki Security SremSsem Rtcmem V2G \
    && cd /home/etsi/dev/STF549_Ng112/scripts \
    && chmod 775 *.bash devenv.bash.* \
    && cd /home/etsi \
    && ln -sf /home/etsi/dev/STF549_Ng112/scripts/devenv.bash.ubuntu /home/etsi/devenv.bash \
    && ls -ltr /home/etsi \
    && export HOME=/home/etsi \
    && . /home/etsi/devenv.bash \
    && cd /home/etsi/dev/STF549_Ng112/scripts \
    && ./build_titan.bash \
    && . /home/etsi/devenv.bash \
    && ./update_emcom_project.bash \
    && cd /home/etsi/dev/etsi_emcom/src/AtsNg112/objs \
    && ../bin/ng112_generate_makefile.bash
CMD ["/bin/bash"]

# That's all Floks
+104 −0
Original line number Diff line number Diff line
FROM ubuntu:18.04

MAINTAINER ETSI STF

LABEL description="STF Docker Ubuntu image"

ENV TERM=linux \
    HOSTNAME=docker-STF

RUN echo "docker-STF-dev" > /etc/hostname \
    && DEBIAN_FRONTEND=noninteractive apt-get update \
    && DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y \
    && 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 \
    && ( echo "oracle-java16-installer shared/accepted-oracle-license-v1-2 boolean true" | debconf-set-selections -v ) \
    && 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 \
      iputils-ping \
      libedit2 \
      libedit-dev \
      libffi-dev \
      libglib2.0-dev \
      libgcrypt-dev \
      libjsoncpp-dev \
      libncurses5-dev \
      libpcap-dev \
      libqt5svg5-dev \
      libssl-dev \
      libtool-bin \
      libtool \
      libwireshark-dev \
      libxml2-dev \
      libxml2-utils \
      libyaml-dev \
      lsof \
      net-tools \
      ntp \
      oracle-java16-installer \
      oracle-java16-set-default \
      openssh-server \
      pkg-config \
      python3-dev \
      python3-pip \
      python3-setuptools \
      qt5-default \
      qtmultimedia5-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 \
    && pip3 install --upgrade setuptools pip \
    && useradd --create-home --shell /bin/bash etsi \
    && echo "etsi:etsi" | chpasswd \
    && adduser etsi sudo \
    && echo "" >> /etc/profile \
    && echo 'export HOME=/home/etsi' >> /etc/profile \
    && echo 'export LD_LIBRARY_PATH=${HOME}/lib:$LD_LIBRARY_PATH' >> /etc/profile \
    && echo 'export PATH=${HOME}/bin:$PATH' >> /etc/profile \
    && echo 'cd ${HOME}' >> /etc/profile \
    && echo ". ./devenv.bash" >> /etc/profile \
    && cd /home/etsi \
    && 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 *

EXPOSE 22

CMD ["/bin/bash"]

# That's all Floks
Loading