2017-06-17 04:04:21 +02:00
|
|
|
# Dockerfile for VILLASnode development.
|
|
|
|
#
|
|
|
|
# This Dockerfile builds an image which contains all library dependencies
|
|
|
|
# and tools to build VILLASnode.
|
|
|
|
# However, VILLASnode itself it not part of the image.
|
|
|
|
#
|
|
|
|
# This image can be used for developing VILLASnode
|
|
|
|
# by running:
|
|
|
|
# make docker
|
|
|
|
#
|
|
|
|
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
|
2020-01-20 17:17:00 +01:00
|
|
|
# @copyright 2014-2020, Institute for Automation of Complex Power Systems, EONERC
|
2017-06-17 04:04:21 +02:00
|
|
|
# @license GNU General Public License (version 3)
|
|
|
|
#
|
|
|
|
# VILLASnode
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# any later version.
|
2017-08-01 11:58:57 +02:00
|
|
|
#
|
2017-06-17 04:04:21 +02:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2017-08-01 11:58:57 +02:00
|
|
|
#
|
2017-06-17 04:04:21 +02:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
###################################################################################
|
|
|
|
|
|
|
|
# You can choose between Debian and Ubuntu here
|
2018-07-04 16:26:35 +02:00
|
|
|
FROM ubuntu:18.04
|
2017-06-17 04:04:21 +02:00
|
|
|
|
2018-07-03 18:25:27 +02:00
|
|
|
ARG GIT_REV=unknown
|
|
|
|
ARG GIT_BRANCH=unknown
|
|
|
|
ARG VERSION=unknown
|
|
|
|
ARG VARIANT=unknown
|
2017-06-17 04:04:21 +02:00
|
|
|
|
2018-07-04 16:26:35 +02:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2017-06-17 04:04:21 +02:00
|
|
|
# Toolchain
|
|
|
|
RUN apt-get update && apt-get install -y \
|
2020-01-25 17:48:36 +01:00
|
|
|
autoconf automake libtool cmake \
|
|
|
|
pkg-config make gcc g++ ninja-build \
|
|
|
|
texinfo git mercurial curl tar \
|
2017-10-27 18:48:09 +02:00
|
|
|
protobuf-compiler protobuf-c-compiler
|
2017-06-17 04:04:21 +02:00
|
|
|
|
|
|
|
# Several tools only needed for developement and testing
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
doxygen dia graphviz \
|
|
|
|
openssh-client \
|
2018-10-20 14:21:07 +02:00
|
|
|
jq netcat \
|
2018-07-04 16:26:35 +02:00
|
|
|
iproute2 \
|
2017-06-17 04:04:21 +02:00
|
|
|
python-pip \
|
2017-08-01 11:58:57 +02:00
|
|
|
valgrind gdb gdbserver \
|
2018-08-20 19:08:57 +02:00
|
|
|
xmlto asciidoctor \
|
|
|
|
rabbitmq-server mosquitto
|
2017-06-17 04:04:21 +02:00
|
|
|
|
|
|
|
# Tools for debugging, coverage, profiling
|
|
|
|
RUN pip install \
|
2017-10-27 19:20:03 +02:00
|
|
|
gcovr \
|
|
|
|
protobuf
|
2017-06-17 04:04:21 +02:00
|
|
|
|
|
|
|
# Dependencies
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
libssl-dev \
|
2019-01-23 15:06:50 +01:00
|
|
|
libprotobuf-dev \
|
|
|
|
libprotobuf-c-dev \
|
|
|
|
uuid-dev \
|
2017-06-17 04:04:21 +02:00
|
|
|
libconfig-dev \
|
|
|
|
libnl-3-dev libnl-route-3-dev \
|
|
|
|
libcurl4-openssl-dev \
|
|
|
|
libjansson-dev \
|
|
|
|
libzmq3-dev \
|
2017-10-27 18:48:09 +02:00
|
|
|
libnanomsg-dev \
|
2018-01-16 09:22:17 +01:00
|
|
|
librabbitmq-dev \
|
2018-07-04 16:26:35 +02:00
|
|
|
libmosquitto-dev \
|
2019-01-23 15:06:50 +01:00
|
|
|
libcomedi-dev \
|
|
|
|
libibverbs-dev \
|
|
|
|
librdmacm-dev \
|
2020-01-25 17:48:36 +01:00
|
|
|
libre-dev \
|
|
|
|
libusb-1.0-0-dev
|
2019-09-03 23:57:22 +02:00
|
|
|
|
|
|
|
# Build & Install fmtlib
|
|
|
|
RUN cd /tmp && \
|
|
|
|
git clone --recursive https://github.com/fmtlib/fmt.git && \
|
|
|
|
mkdir -p fmt/build && cd fmt/build && \
|
2019-09-16 16:08:01 +02:00
|
|
|
git checkout 5.2.0 && \
|
2019-09-16 16:03:45 +02:00
|
|
|
cmake -DBUILD_SHARED_LIBS=1 .. && make -j$(nproc) install && \
|
2020-01-25 17:36:29 +01:00
|
|
|
rm -rf /tmp/fmt
|
2019-09-03 23:57:22 +02:00
|
|
|
|
|
|
|
# Build & Install spdlog
|
|
|
|
RUN cd /tmp && \
|
|
|
|
git clone --recursive https://github.com/gabime/spdlog.git && \
|
|
|
|
mkdir -p spdlog/build && cd spdlog/build && \
|
|
|
|
git checkout v1.3.1 && \
|
2019-09-16 16:03:45 +02:00
|
|
|
cmake -DCMAKE_BUILD_TYPE=Release -DSPDLOG_FMT_EXTERNAL=1 -DSPDLOG_BUILD_BENCH=OFF .. && make -j$(nproc) install && \
|
2020-01-25 17:36:29 +01:00
|
|
|
rm -rf /tmp/spdlog
|
2017-06-17 04:04:21 +02:00
|
|
|
|
|
|
|
# Build & Install Criterion
|
2018-07-04 16:26:35 +02:00
|
|
|
RUN cd /tmp && \
|
|
|
|
git clone --recursive https://github.com/Snaipe/Criterion && \
|
|
|
|
mkdir -p Criterion/build && cd Criterion/build && \
|
2020-01-25 17:36:29 +01:00
|
|
|
git checkout v2.3.3 && \
|
2019-01-23 15:07:08 +01:00
|
|
|
cmake -DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 .. && make -j$(nproc) install && \
|
2020-01-25 17:36:29 +01:00
|
|
|
rm -rf /tmp/Criterion
|
2017-06-17 04:04:21 +02:00
|
|
|
|
2019-01-23 15:06:50 +01:00
|
|
|
# Build & Install libwebsockets
|
2018-07-04 16:26:35 +02:00
|
|
|
RUN cd /tmp && \
|
2019-01-23 15:06:50 +01:00
|
|
|
git clone -b v3.1-stable https://github.com/warmcat/libwebsockets && \
|
2018-07-04 16:26:35 +02:00
|
|
|
mkdir -p libwebsockets/build && cd libwebsockets/build && \
|
2019-10-26 16:39:54 +02:00
|
|
|
cmake -DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 -DLWS_WITHOUT_TESTAPPS=ON .. && make -j$(nproc) install && \
|
2020-01-25 17:36:29 +01:00
|
|
|
rm -rf /tmp/libwebsockets
|
2017-06-17 04:04:21 +02:00
|
|
|
|
2017-11-17 17:53:16 +01:00
|
|
|
# Build & Install libiec61850
|
2018-07-04 16:26:35 +02:00
|
|
|
RUN cd /tmp && \
|
2019-01-23 15:06:50 +01:00
|
|
|
git clone -b v1.3.1 https://github.com/mz-automation/libiec61850 && \
|
2018-07-04 16:26:35 +02:00
|
|
|
mkdir -p libiec61850/build && cd libiec61850/build && \
|
2019-01-23 15:07:08 +01:00
|
|
|
cmake -DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 .. && make -j$(nproc) install && \
|
2020-01-25 17:36:29 +01:00
|
|
|
rm -rf /tmp/libiec61850
|
|
|
|
|
|
|
|
# Build & Install uldaq
|
|
|
|
RUN cd /tmp && \
|
|
|
|
git clone -b rpm https://github.com/stv0g/uldaq && \
|
|
|
|
cd uldaq && \
|
|
|
|
autoreconf -i && ./configure --enable-examples=no && \
|
|
|
|
make -j$(nproc) install && \
|
|
|
|
rm -rf /tmp/uldaq
|
|
|
|
|
|
|
|
# Build & Install EtherLab
|
2020-01-25 17:48:36 +01:00
|
|
|
RUN cd /tmp && \
|
2020-01-25 17:36:29 +01:00
|
|
|
hg clone --branch stable-1.5 http://hg.code.sf.net/p/etherlabmaster/code etherlab && \
|
|
|
|
cd etherlab && \
|
|
|
|
./bootstrap && ./configure --enable-userlib=yes --enable-kernel=no --enable-tool=no && \
|
|
|
|
make -j$(nproc) install && \
|
|
|
|
rm -rf /tmp/etherlab
|
2017-11-17 17:53:16 +01:00
|
|
|
|
2017-06-17 04:04:21 +02:00
|
|
|
# Expose ports for HTTP and WebSocket frontend
|
|
|
|
EXPOSE 80
|
|
|
|
EXPOSE 443
|
|
|
|
|
|
|
|
ENV LD_LIBRARY_PATH /usr/local/lib:/usr/local/lib64
|
|
|
|
|
2017-07-12 00:52:24 +02:00
|
|
|
# Workaround for libnl3's search path for netem distributions
|
|
|
|
RUN ln -s /usr/lib64/tc /usr/lib/tc
|
|
|
|
|
2017-06-17 04:04:21 +02:00
|
|
|
WORKDIR /villas
|
|
|
|
ENTRYPOINT bash
|
2018-05-15 18:59:06 +02:00
|
|
|
|
|
|
|
LABEL \
|
|
|
|
org.label-schema.schema-version="1.0" \
|
|
|
|
org.label-schema.name="VILLASnode" \
|
|
|
|
org.label-schema.license="GPL-3.0" \
|
|
|
|
org.label-schema.vcs-ref="$GIT_REV" \
|
|
|
|
org.label-schema.vcs-branch="$GIT_BRANCH" \
|
|
|
|
org.label-schema.version="$VERSION" \
|
|
|
|
org.label-schema.variant="$VARIANT" \
|
|
|
|
org.label-schema.vendor="Institute for Automation of Complex Power Systems, RWTH Aachen University" \
|
|
|
|
org.label-schema.author.name="Steffen Vogel" \
|
|
|
|
org.label-schema.author.email="stvogel@eonerc.rwth-aachen.de" \
|
|
|
|
org.label-schema.description="A image containing all build-time dependencies for VILLASnode based on Ubuntu" \
|
|
|
|
org.label-schema.url="http://fein-aachen.org/projects/villas-framework/" \
|
2020-02-02 13:10:15 +01:00
|
|
|
org.label-schema.vcs-url="https://git.rwth-aachen.de/acs/public/villas/node" \
|
2018-05-15 18:59:06 +02:00
|
|
|
org.label-schema.usage="https://villas.fein-aachen.org/doc/node-installation.html#node-installation-docker"
|