From 6ca8213f76b28aff6d8c17b14feb2241a52c4eed Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Tue, 2 Jun 2020 23:48:42 +0200 Subject: [PATCH] update other Dockerfile to use new deps script --- packaging/deps.sh | 20 +++-- packaging/docker/Dockerfile.dev | 11 --- packaging/docker/Dockerfile.dev-centos | 89 +++---------------- .../docker/Dockerfile.dev-debian-multiarch | 57 ++---------- packaging/docker/Dockerfile.dev-raspbian | 52 +---------- packaging/docker/Dockerfile.dev-ubuntu | 58 +----------- 6 files changed, 36 insertions(+), 251 deletions(-) diff --git a/packaging/deps.sh b/packaging/deps.sh index 2dc84f20a..7314f22bb 100644 --- a/packaging/deps.sh +++ b/packaging/deps.sh @@ -22,15 +22,17 @@ mkdir -p thirdparty pushd thirdparty # Build & Install Criterion -git clone --recursive https://github.com/Snaipe/Criterion -mkdir -p Criterion/build -pushd Criterion/build -git checkout v2.3.3 -cmake -DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 .. -if [ -z "${PACKAGE}" ]; then - make -j$(nproc) install +if [ $(uname -m) != "armv6l" ]; then + git clone --recursive https://github.com/Snaipe/Criterion + mkdir -p Criterion/build + pushd Criterion/build + git checkout v2.3.3 + cmake -DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 .. + if [ -z "${PACKAGE}" ]; then + make -j$(nproc) install + fi + popd fi -popd # Build & Install EtherLab hg clone --branch stable-1.5 http://hg.code.sf.net/p/etherlabmaster/code etherlab @@ -129,4 +131,4 @@ if [ -n "${PACKAGE}" ]; then cp ~/rpmbuild/RPMS/x86_64/*.rpm rpms fi -popd \ No newline at end of file +popd diff --git a/packaging/docker/Dockerfile.dev b/packaging/docker/Dockerfile.dev index 83560259e..d57134a48 100644 --- a/packaging/docker/Dockerfile.dev +++ b/packaging/docker/Dockerfile.dev @@ -82,17 +82,6 @@ RUN dnf -y install \ librdmacm-devel \ libusb-devel -# Some of the dependencies are only available in our own repo -# ADD https://packages.fein-aachen.org/fedora/fein.repo /etc/yum.repos.d/ -# RUN dnf -y install \ -# re-devel \ -# libiec61850-devel \ -# etherlab-devel \ -# fmt-devel \ -# spdlog-devel \ -# uldaq-devel \ -# comedilib-devel - # or install unpackaged dependencies from source ADD packaging/deps.sh / RUN bash deps.sh diff --git a/packaging/docker/Dockerfile.dev-centos b/packaging/docker/Dockerfile.dev-centos index 8af6375db..2e5837273 100644 --- a/packaging/docker/Dockerfile.dev-centos +++ b/packaging/docker/Dockerfile.dev-centos @@ -28,51 +28,34 @@ # along with this program. If not, see . ################################################################################### -# This is a Centos 7 image including the devtoolset-7 for a more up-to-date toolchain -# See: https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ -FROM registry.centos.org/centos/devtoolset-7-toolchain-centos7 +FROM centos:8 ARG GIT_REV=unknown ARG GIT_BRANCH=unknown ARG VERSION=unknown ARG VARIANT=unknown -# Some of the dependencies are only available in our own repo -ADD https://packages.fein-aachen.org/redhat/fein.repo /etc/yum.repos.d/ - USER root -# Enable Extra Packages for Enterprise Linux (EPEL) repo -RUN yum -y install epel-release +# Enable Extra Packages for Enterprise Linux (EPEL) repo and PowerTools +RUN dnf -y install epel-release dnf-plugins-core +RUN dnf config-manager --set-enabled PowerTools # Toolchain -RUN yum -y install \ - devtoolset-7-toolchain \ - pkgconfig make cmake3 \ +RUN dnf -y install \ + pkgconfig make cmake \ autoconf automake autogen libtool \ flex bison \ texinfo git mercurial curl tar \ protobuf-compiler protobuf-c-compiler -# Several tools only needed for developement and testing -RUN yum -y install \ - doxygen dia graphviz \ - openssh-clients \ - rpmdevtools rpm-build \ - jq netcat \ - iproute \ - python-pip \ - valgrind gdb gdb-gdbserver \ - xmlto rubygem-asciidoctor \ - rabbitmq-server mosquitto - # Tools for debugging, coverage, profiling RUN pip install \ gcovr \ protobuf # Dependencies -RUN yum -y install \ +RUN dnf -y install \ openssl-devel \ protobuf-devel \ protobuf-c-devel \ @@ -81,69 +64,17 @@ RUN yum -y install \ libnl3-devel \ libcurl-devel \ jansson-devel \ - libwebsockets-devel \ zeromq-devel \ nanomsg \ librabbitmq-devel \ mosquitto-devel \ libibverbs-devel \ librdmacm-devel \ - re-devel \ libusb1-devel -# Build & Install fmtlib -RUN cd /tmp && \ - git clone --recursive https://github.com/fmtlib/fmt.git && \ - mkdir -p fmt/build && cd fmt/build && \ - git checkout 5.2.0 && \ - cmake3 -DBUILD_SHARED_LIBS=1 .. && make -j$(nproc) install && \ - rm -rf /tmp/fmt - -# 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 && \ - cmake3 -DCMAKE_BUILD_TYPE=Release -DSPDLOG_FMT_EXTERNAL=1 -DSPDLOG_BUILD_BENCH=OFF .. && make -j$(nproc) install && \ - rm -rf /tmp/spdlog - -# Build & Install Criterion -#RUN cd /tmp && \ -# git clone --recursive https://github.com/Snaipe/Criterion && \ -# mkdir -p Criterion/build && cd Criterion/build && \ -# git checkout v2.3.3 && \ -# cmake3 -DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 .. && make install && \ -# rm -rf /tmp/* - -# Build & Install libwebsockets -RUN cd /tmp && \ - git clone -b v3.1-stable https://github.com/warmcat/libwebsockets && \ - mkdir -p libwebsockets/build && cd libwebsockets/build && \ - cmake3 -DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 -DLWS_WITHOUT_TESTAPPS=ON .. && make -j$(nproc) install && \ - rm -rf /tmp/libwebsockets - -# Build & Install libiec61850 -RUN cd /tmp && \ - git clone -b v1.3.1 https://github.com/mz-automation/libiec61850 && \ - mkdir -p libiec61850/build && cd libiec61850/build && \ - cmake3 -DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 .. && make -j$(nproc) install && \ - 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 -RUN cd /tmp && \ - 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 +# or install unpackaged dependencies from source +ADD packaging/deps.sh / +RUN bash deps.sh # Workaround for libnl3's search path for netem distributions RUN ln -s /usr/lib64/tc /usr/lib/tc diff --git a/packaging/docker/Dockerfile.dev-debian-multiarch b/packaging/docker/Dockerfile.dev-debian-multiarch index 727448e15..9dbafd663 100644 --- a/packaging/docker/Dockerfile.dev-debian-multiarch +++ b/packaging/docker/Dockerfile.dev-debian-multiarch @@ -47,8 +47,9 @@ RUN dpkg --add-architecture ${ARCH} # Toolchain RUN apt-get update && apt-get install -y \ crossbuild-essential-${ARCH} \ - pkg-config make ninja-build \ - texinfo git mercurial curl tar wget\ + autoconf automake autogen libtool \ + pkg-config make \ + texinfo git mercurial curl tar wget \ protobuf-compiler protobuf-c-compiler # Dependencies @@ -65,7 +66,6 @@ RUN apt-get update && apt-get install -y \ libnanomsg-dev:${ARCH} \ librabbitmq-dev:${ARCH} \ libmosquitto-dev:${ARCH} \ - libcomedi-dev:${ARCH} \ libibverbs-dev:${ARCH} \ librdmacm-dev:${ARCH} \ libre-dev:${ARCH} \ @@ -84,54 +84,11 @@ ENV PKG_CONFIG_PATH=/usr/lib/${TRIPLET}/pkgconfig:/usr/local/lib/pkgconfig:/usr/ ENV PKG_CONFIG_LIBDIR=/usr/lib/${TRIPLET}/pkgconfig:/usr/share/pkgconfig ENV CMAKE_OPTS="-DCMAKE_TOOLCHAIN_FILE=/debian-${ARCH}.cmake \ - -DCMAKE_INSTALL_LIBDIR=/usr/lib/${TRIPLET}" - -# Build & Install fmtlib -RUN cd /tmp && \ - git clone --recursive https://github.com/fmtlib/fmt.git && \ - mkdir -p fmt/build && cd fmt/build && \ - git checkout 5.2.0 && \ - cmake ${CMAKE_OPTS} -DBUILD_SHARED_LIBS=1 .. && make -j$(nproc) install && \ - rm -rf /tmp/fmt - -# 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 && \ - cmake ${CMAKE_OPTS} -DCMAKE_BUILD_TYPE=Release -DSPDLOG_FMT_EXTERNAL=1 -DSPDLOG_BUILD_BENCH=OFF .. && make -j$(nproc) install && \ - rm -rf /tmp/spdlog + -DCMAKE_INSTALL_LIBDIR=/usr/lib/${TRIPLET}" -# Build & Install libwebsockets -RUN cd /tmp && \ - git clone -b v3.1-stable https://github.com/warmcat/libwebsockets && \ - mkdir -p libwebsockets/build && cd libwebsockets/build && \ - cmake ${CMAKE_OPTS} -DLWS_INSTALL_LIB_DIR=/usr/lib/${TRIPLET} -DLWS_WITHOUT_TESTAPPS=ON .. && make -j$(nproc) install && \ - rm -rf /tmp/libwebsockets - -# Build & Install libiec61850 -RUN cd /tmp && \ - git clone -b v1.3.1 https://github.com/mz-automation/libiec61850 && \ - mkdir -p libiec61850/build && cd libiec61850/build && \ - cmake ${CMAKE_OPTS} .. && make -j$(nproc) install && \ - rm -rf /tmp/libiec61850 - -# Build & Install uldaq -RUN apt-get -y install automake autoconf libtool -RUN cd /tmp && \ - git clone -b rpm https://github.com/stv0g/uldaq && \ - mkdir -p uldaq/build && cd uldaq && \ - autoreconf -i && cd build && \ - ../configure --host=${TRIPLET} && make -j$(nproc) install && \ - rm -rf /tmp/uldaq - -# Build & Install EtherLab -RUN cd /tmp && \ - hg clone --branch stable-1.5 http://hg.code.sf.net/p/etherlabmaster/code etherlab && \ - cd etherlab && \ - ./bootstrap && ./configure --host=${TRIPLET} --enable-userlib=yes --enable-kernel=no --enable-tool=no && \ - make -j$(nproc) install && \ - rm -rf /tmp/etherlab +# Install unpackaged dependencies from source +ADD packaging/deps.sh / +RUN bash deps.sh WORKDIR /villas ENTRYPOINT bash diff --git a/packaging/docker/Dockerfile.dev-raspbian b/packaging/docker/Dockerfile.dev-raspbian index ee9c1ed3a..113e6f421 100644 --- a/packaging/docker/Dockerfile.dev-raspbian +++ b/packaging/docker/Dockerfile.dev-raspbian @@ -30,7 +30,7 @@ ARG VARIANT=unknown # Toolchain RUN apt-get update && \ apt-get install -y \ - autoconf automake libtool cmake \ + autoconf automake autogen libtool cmake \ pkg-config make gcc g++\ git mercurial curl wget tar bzip2 \ protobuf-compiler protobuf-c-compiler @@ -50,9 +50,7 @@ RUN apt-get update && \ libnanomsg-dev \ librabbitmq-dev \ libmosquitto-dev \ - libcomedi-dev \ librdmacm-dev \ - libre-dev \ libusb-1.0-0-dev ENV CC=gcc @@ -61,51 +59,9 @@ ENV CXX=g++ # Add CMake install dir to PATH ENV PATH="usr/local/bin:${PATH}" -# Build & Install fmtlib -RUN cd /tmp && \ - git clone --recursive https://github.com/fmtlib/fmt.git && \ - mkdir -p fmt/build && cd fmt/build && \ - git checkout 5.2.0 && \ - cmake -DBUILD_SHARED_LIBS=1 .. && make -j$(nproc) install && \ - rm -rf /tmp/fmt - -# 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 && \ - cmake -DCMAKE_BUILD_TYPE=Release -DSPDLOG_FMT_EXTERNAL=1 -DSPDLOG_BUILD_BENCH=OFF .. && make -j$(nproc) install && \ - rm -rf /tmp/spdlog - -# Build & Install libwebsockets -RUN cd /tmp && \ - git clone -b v3.1-stable https://github.com/warmcat/libwebsockets && \ - mkdir -p libwebsockets/build && cd libwebsockets/build && \ - cmake -DLWS_WITHOUT_TESTAPPS=ON .. && make -j$(nproc) install && \ - rm -rf /tmp/libwebsockets - -# Build & Install libiec61850 -RUN cd /tmp && \ - git clone -b v1.3.1 https://github.com/mz-automation/libiec61850 && \ - mkdir -p libiec61850/build && cd libiec61850/build && \ - cmake .. && make -j$(nproc) install && \ - 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 -RUN cd /tmp && \ - 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 +# Install unpackaged dependencies from source +ADD packaging/deps.sh / +RUN bash deps.sh # Expose ports for HTTP and WebSocket frontend EXPOSE 80 diff --git a/packaging/docker/Dockerfile.dev-ubuntu b/packaging/docker/Dockerfile.dev-ubuntu index 893262ee6..e5d23012f 100644 --- a/packaging/docker/Dockerfile.dev-ubuntu +++ b/packaging/docker/Dockerfile.dev-ubuntu @@ -43,6 +43,7 @@ RUN apt-get update && apt-get install -y \ autoconf automake libtool cmake \ pkg-config make gcc g++ ninja-build \ texinfo git mercurial curl tar \ + flex bison \ protobuf-compiler protobuf-c-compiler # Several tools only needed for developement and testing @@ -78,62 +79,11 @@ RUN apt-get update && apt-get install -y \ libcomedi-dev \ libibverbs-dev \ librdmacm-dev \ - libre-dev \ libusb-1.0-0-dev -# Build & Install fmtlib -RUN cd /tmp && \ - git clone --recursive https://github.com/fmtlib/fmt.git && \ - mkdir -p fmt/build && cd fmt/build && \ - git checkout 5.2.0 && \ - cmake -DBUILD_SHARED_LIBS=1 .. && make -j$(nproc) install && \ - rm -rf /tmp/fmt - -# 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 && \ - cmake -DCMAKE_BUILD_TYPE=Release -DSPDLOG_FMT_EXTERNAL=1 -DSPDLOG_BUILD_BENCH=OFF .. && make -j$(nproc) install && \ - rm -rf /tmp/spdlog - -# Build & Install Criterion -RUN cd /tmp && \ - git clone --recursive https://github.com/Snaipe/Criterion && \ - mkdir -p Criterion/build && cd Criterion/build && \ - git checkout v2.3.3 && \ - cmake -DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 .. && make -j$(nproc) install && \ - rm -rf /tmp/Criterion - -# Build & Install libwebsockets -RUN cd /tmp && \ - git clone -b v3.1-stable https://github.com/warmcat/libwebsockets && \ - mkdir -p libwebsockets/build && cd libwebsockets/build && \ - cmake -DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 -DLWS_WITHOUT_TESTAPPS=ON .. && make -j$(nproc) install && \ - rm -rf /tmp/libwebsockets - -# Build & Install libiec61850 -RUN cd /tmp && \ - git clone -b v1.3.1 https://github.com/mz-automation/libiec61850 && \ - mkdir -p libiec61850/build && cd libiec61850/build && \ - cmake -DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 .. && make -j$(nproc) install && \ - 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 -RUN cd /tmp && \ - 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 +# or install unpackaged dependencies from source +ADD packaging/deps.sh / +RUN bash deps.sh # Expose ports for HTTP and WebSocket frontend EXPOSE 80