Index: trunk/BNC/Dockerfile
===================================================================
--- trunk/BNC/Dockerfile	(revision 9757)
+++ 	(revision )
@@ -1,28 +1,0 @@
-# ##############################################
-# Dockerfile for building BNC on debian with Qt5
-# ##############################################
-# Usage: docker/podman build -t bnc:2.13 .
-FROM debian:buster-slim
-#FROM ubuntu:20.10
-
-LABEL maintainer="igs-ip@bkg.bund.de"
-LABEL version="2.13"
-
-RUN apt update && apt upgrade -y
-RUN apt install -y build-essential libssl-dev
-RUN apt install -y qtbase5-dev libqt5svg5-dev
-
-COPY bnc_plugin.pro bnc.pro /tmp/BNC/
-COPY newmat /tmp/BNC/newmat/
-COPY qwt /tmp/BNC/qwt/
-COPY qwtpolar /tmp/BNC/qwtpolar/
-COPY src /tmp/BNC/src/
-
-# Build
-WORKDIR /tmp/BNC
-RUN qmake -qt=5 bnc.pro && make
-
-# Print version
-RUN echo '/tmp/BNC/bnc created'
-RUN ./bnc --version
-#RUN cat /etc/*release && gcc --version && qmake -qt=5 --version
Index: trunk/BNC/docker/Dockerfile.bullseye
===================================================================
--- trunk/BNC/docker/Dockerfile.bullseye	(revision 9759)
+++ trunk/BNC/docker/Dockerfile.bullseye	(revision 9759)
@@ -0,0 +1,26 @@
+# Usage: cd .. && docker/podman build -t bullseye/bnc:v2.13.0 -f docker/Dockerfile.bullseye .
+
+FROM debian:bullseye-slim
+
+RUN apt update && apt upgrade -y
+RUN apt install -y build-essential libssl-dev
+RUN apt install -y \
+    qtbase5-dev \
+    libqt5concurrent5 \
+    libqt5network5 \
+    libqt5printsupport5 \
+    libqt5svg5-dev \
+    libqt5opengl5
+
+COPY bnc_plugin.pro bnc.pro /tmp/BNC/
+COPY newmat /tmp/BNC/newmat/
+COPY qwt /tmp/BNC/qwt/
+COPY qwtpolar /tmp/BNC/qwtpolar/
+COPY src /tmp/BNC/src/
+
+WORKDIR /tmp/BNC
+RUN qmake -qt=5 bnc.pro && make
+
+RUN echo '/tmp/BNC/bnc created'
+RUN ./bnc --version
+RUN cat /etc/*release && gcc --version && qmake -qt=5 --version
Index: trunk/BNC/docker/Dockerfile.buster
===================================================================
--- trunk/BNC/docker/Dockerfile.buster	(revision 9759)
+++ trunk/BNC/docker/Dockerfile.buster	(revision 9759)
@@ -0,0 +1,28 @@
+# Usage: cd .. && docker/podman build -t buster/bnc:v2.13.0 -f docker/Dockerfile.buster .
+
+FROM debian:buster-slim
+
+RUN apt update && apt upgrade -y
+RUN apt install -y build-essential libssl-dev
+RUN apt install -y \
+    qtbase5-dev \
+    libqt5concurrent5 \
+    libqt5network5 \
+    libqt5printsupport5 \
+    libqt5svg5-dev \
+    libqt5opengl5
+
+COPY bnc_plugin.pro bnc.pro /tmp/BNC/
+COPY newmat /tmp/BNC/newmat/
+COPY qwt /tmp/BNC/qwt/
+COPY qwtpolar /tmp/BNC/qwtpolar/
+COPY src /tmp/BNC/src/
+
+# Build
+WORKDIR /tmp/BNC
+RUN qmake -qt=5 bnc.pro && make
+
+# Print version
+RUN echo '/tmp/BNC/bnc created'
+RUN ./bnc --version
+RUN cat /etc/*release && gcc --version && qmake -qt=5 --version
Index: trunk/BNC/docker/Dockerfile.leap
===================================================================
--- trunk/BNC/docker/Dockerfile.leap	(revision 9759)
+++ trunk/BNC/docker/Dockerfile.leap	(revision 9759)
@@ -0,0 +1,23 @@
+FROM opensuse/leap:15.3
+
+RUN zypper -n update
+RUN zypper -n in gcc-c++ libpng-devel libopenssl-devel unzip
+RUN zypper -n in \
+    libQt5Concurrent-devel \
+    libQt5Network-devel \
+    libQt5PrintSupport-devel \
+    libqt5-qtsvg-devel \
+    libQt5OpenGL-devel
+
+COPY bnc_plugin.pro bnc.pro /tmp/BNC/
+COPY newmat /tmp/BNC/newmat/
+COPY qwt /tmp/BNC/qwt/
+COPY qwtpolar /tmp/BNC/qwtpolar/
+COPY src /tmp/BNC/src/
+
+WORKDIR /tmp/BNC
+RUN qmake-qt5 bnc.pro && make
+
+RUN echo '/tmp/BNC/bnc created'
+RUN ./bnc --version
+RUN cat /etc/*release && gcc --version && qmake-qt5 --version
Index: trunk/BNC/docker/Dockerfile.ubi8
===================================================================
--- trunk/BNC/docker/Dockerfile.ubi8	(revision 9759)
+++ trunk/BNC/docker/Dockerfile.ubi8	(revision 9759)
@@ -0,0 +1,22 @@
+FROM redhat/ubi8:8.6
+
+RUN dnf -y update
+RUN dnf -y install gcc-c++ libpng-devel openssl-devel unzip
+RUN dnf -y install \
+    qt5-qtbase-devel \
+    qt5-qtsvg-devel \
+    qt5-qtwebkit-devel \
+    qt5-qtwebengine-devel
+
+COPY bnc_plugin.pro bnc.pro /tmp/BNC/
+COPY newmat /tmp/BNC/newmat/
+COPY qwt /tmp/BNC/qwt/
+COPY qwtpolar /tmp/BNC/qwtpolar/
+COPY src /tmp/BNC/src/
+
+WORKDIR /tmp/BNC
+RUN qmake-qt5 bnc.pro && make
+
+RUN echo '/tmp/BNC/bnc created'
+RUN ./bnc --version
+RUN cat /etc/*release && gcc --version && qmake-qt5 --version
Index: trunk/BNC/docker/README.md
===================================================================
--- trunk/BNC/docker/README.md	(revision 9759)
+++ trunk/BNC/docker/README.md	(revision 9759)
@@ -0,0 +1,18 @@
+# Build BNC from sources for multiple operating systems
+
+Docker or podman must be installed on your system, see [Podman Installation Instructions](https://podman.io/getting-started/installation).<br>
+The Dockerfiles should work with both commands, docker and podman.
+
+Build example:
+
+```bash
+cd to/BNC/root/dir
+podman build -t bullseye/bnc:v2.13 -f docker/Dockerfile.bullseye .
+```
+
+#### Copy the build artifact from the container
+```bash
+con=$(podman create <imageID>)
+podman cp $con:/tmp/BNC/bnc bncnew
+podman rm $con
+```
Index: trunk/BNC/docker/build.sh
===================================================================
--- trunk/BNC/docker/build.sh	(revision 9759)
+++ trunk/BNC/docker/build.sh	(revision 9759)
@@ -0,0 +1,74 @@
+#!/bin/bash
+
+# Build BNC from sources for multiple operating systems
+# On redhat/centos install "dnf install podman-docker"
+# Wiese, 2022
+
+set -e
+cd "$(dirname $0)/.."
+
+bncvers=$(grep "#define BNCVERSION \"" src/bncversion.h | cut -d " " -f3 | tr -d \")
+if [ -z "$bncvers" ]; then
+  echo "ERROR: could not find bncvers"; exit 1
+fi
+
+# Run image, copy the compiled executable "bncnew" from the container
+# and then remove the container.
+function getBncFromImage () {
+  local image="$1"
+  local imgID=$(docker images --format "{{.ID}}" $image)
+  local con=$(docker create $imgID)
+  docker cp $con:/tmp/BNC/bnc bncnew
+  docker rm $con
+  [ -s "bncnew" ] || { echo "executable \"bncnew\" does not exist"; exit 1; }
+}
+
+function buildBullseye () {
+  echo "Build BNC $bncvers for debian 11 (bullseye) ..."
+  [ -f "bncnew" ] && rm bncnew
+  docker build -t bullseye/bnc:v$bncvers -f docker/Dockerfile.bullseye .
+  getBncFromImage "bullseye/bnc:v$bncvers"
+  target=$(realpath "bnc-$bncvers-debian11")
+  mv bncnew $target
+  echo "$target created"
+}
+
+function buildLeap () {
+  echo "Build BNC $bncvers for opensuse (leap) ..."
+  [ -f "bncnew" ] && rm bncnew
+  docker build -t leap/bnc:v$bncvers -f docker/Dockerfile.leap .
+  getBncFromImage "leap/bnc:v$bncvers"
+  target=$(realpath "bnc-$bncvers-leap")
+  mv bncnew $target
+  echo "$target created"
+}
+
+function buildUbi8 () {
+  echo "Build BNC $bncvers for redhat/ubi8 ..."
+  [ -f "bncnew" ] && rm bncnew
+  docker build -t ubi8.6/bnc:v$bncvers -f docker/Dockerfile.ubi8 .
+  getBncFromImage "ubi8.6/bnc:v$bncvers"
+  target=$(realpath "bnc-$bncvers-el8.6")
+  mv bncnew $target
+  echo "$target created"
+}
+
+case $1 in
+     "bullseye")
+         buildBullseye;
+         ;;
+     "leap")
+         buildLeap;
+         ;;
+     "all")
+         buildBullseye;
+         buildLeap;
+         ;;
+     *)
+         echo "Usage:"
+         echo "    $0 { bullseye | leap | ubi8 | all }"
+         echo
+         exit 1;
+         ;;
+esac
+
