|
| 1 | +# Rockylinux Dockerfile |
| 2 | +# |
| 3 | +# Author: Steffen Vogel < [email protected]> |
| 4 | +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University |
| 5 | +# SPDX-License-Identifier: Apache-2.0 |
| 6 | + |
| 7 | +ARG DISTRO=rockylinux/rockylinux |
| 8 | +ARG ROCKY_VERSION=9.6 |
| 9 | + |
| 10 | +FROM ${DISTRO}:${ROCKY_VERSION} AS dev |
| 11 | + |
| 12 | +ARG DISTRO |
| 13 | + |
| 14 | +USER root |
| 15 | + |
| 16 | +# Enable Extra Packages for Enterprise Linux (EPEL) repo and PowerTools |
| 17 | +RUN dnf -y install epel-release dnf-plugins-core |
| 18 | +RUN dnf config-manager --set-enabled crb |
| 19 | + |
| 20 | +# Toolchain |
| 21 | +RUN dnf --allowerasing -y install \ |
| 22 | + gcc gcc-c++ \ |
| 23 | + pkgconfig cmake make meson \ |
| 24 | + autoconf automake libtool ninja-build \ |
| 25 | + flex bison \ |
| 26 | + texinfo git git-svn curl tar patchutils \ |
| 27 | + protobuf-compiler protobuf-c-compiler \ |
| 28 | + clang-tools-extra |
| 29 | + |
| 30 | +# Dependencies |
| 31 | +RUN dnf -y install \ |
| 32 | + openssl-devel \ |
| 33 | + graphviz-devel \ |
| 34 | + protobuf-devel \ |
| 35 | + protobuf-c-devel \ |
| 36 | + libuuid-devel \ |
| 37 | + libconfig-devel \ |
| 38 | + libnl3-devel \ |
| 39 | + libcurl-devel \ |
| 40 | + jansson-devel \ |
| 41 | + zeromq-devel \ |
| 42 | + librabbitmq-devel \ |
| 43 | + mosquitto-devel \ |
| 44 | + librdkafka-devel \ |
| 45 | + libibverbs-devel \ |
| 46 | + librdmacm-devel \ |
| 47 | + libusb1-devel \ |
| 48 | + lua-devel \ |
| 49 | + hiredis-devel \ |
| 50 | + libnice-devel \ |
| 51 | + libmodbus-devel |
| 52 | + |
| 53 | +# Install unpackaged dependencies from source |
| 54 | +ADD packaging/patches /deps/patches |
| 55 | +ADD packaging/deps.sh /deps |
| 56 | +RUN bash /deps/deps.sh |
| 57 | +RUN echo "/usr/local/openDSSC/bin/" > /etc/ld.so.conf.d/opendssc.conf && \ |
| 58 | + ldconfig |
| 59 | + |
| 60 | +# Workaround for libnl3's search path for netem distributions |
| 61 | +RUN ln -s /usr/lib64/tc /usr/lib/tc |
| 62 | + |
| 63 | +# Workaround for broken Linux headers |
| 64 | +ADD packaging/reverse-struct-group.patch . |
| 65 | +RUN cat /usr/include/linux/pkt_cls.h |
| 66 | +RUN patch -F3 -d /usr -p1 -u < reverse-struct-group.patch |
| 67 | + |
| 68 | +# Expose ports for HTTP and WebSocket frontend |
| 69 | +EXPOSE 80 |
| 70 | +EXPOSE 443 |
| 71 | + |
| 72 | +WORKDIR /villas |
| 73 | + |
| 74 | +ENV LC_ALL=C.UTF-8 |
| 75 | +ENV LANG=C.UTF-8 |
| 76 | + |
| 77 | +FROM dev AS app |
| 78 | + |
| 79 | +ARG CMAKE_OPTS |
| 80 | + |
| 81 | +COPY . /villas/ |
| 82 | + |
| 83 | +RUN rm -rf /villas/build && mkdir /villas/build |
| 84 | +WORKDIR /villas/build |
| 85 | +RUN cmake ${CMAKE_OPTS} .. && \ |
| 86 | + make -j$(nproc) install && \ |
| 87 | + ldconfig |
| 88 | + |
| 89 | +ENTRYPOINT ["villas"] |
| 90 | + |
| 91 | +LABEL \ |
| 92 | + org.label-schema.schema-version="1.0" \ |
| 93 | + org.label-schema.name="VILLASnode" \ |
| 94 | + org.label-schema.license="Apache-2.0" \ |
| 95 | + org.label-schema.vendor="The VILLASframework authors" \ |
| 96 | + org.label-schema.author.name="Steffen Vogel" \ |
| 97 | + org.label-schema.author.email=" [email protected]" \ |
| 98 | + org.label-schema.description="A image containing all build-time dependencies for VILLASnode based on Rocky Linux 9" \ |
| 99 | + org.label-schema.url="http://fein-aachen.org/projects/villas-framework/" \ |
| 100 | + org.label-schema.vcs-url="https://github.com/VILLASframework/node" \ |
| 101 | + org.label-schema.usage="https://villas.fein-aachen.org/docs/node/installation#docker" |
0 commit comments