Dockerize the EdgeApp

Hi everybody,
I wanted to ask if anybody has ever dockerized the EdgeApp? If yes, can you share your Dockerfile and docker-compose files?
Cheers,
Karolina

Hi Karolina,

OpenEMS is used widely in Docker containers, e.g. our Gitpod Live-Demo is powered by Docker (see the Gitpod specific Docker configuration here: openems/.gitpod.Dockerfile at develop Ā· OpenEMS/openems Ā· GitHub). Unfortunately there is no ā€˜standardā€™ Docker container available yet.

You can build your own dockerized OpenEMS Edge using the following Linux commands:

  • Create a working directory and change to it
mkdir openems-edge
cd openems-edge
  • Create subdirectories for configuration files and storage data
mkdir -p config data`
  • Create a Dockerfile:
cat <<EOF > Dockerfile
FROM eclipse-temurin:11-jre-alpine
RUN mkdir /opt/openems-edge
COPY openems-edge.jar /opt/openems-edge
CMD ["java", "-jar", "-Dfelix.cm.dir=/etc/openems.d/", "-Dopenems.data.dir=/var/lib/openems/", "/opt/openems-edge/openems-edge.jar"]
EOF
  • Provide a openems-edge.jar file in the current directory. For example this command downloads the latest artifact from the latest GitHub Release version:
curl -s https://api.github.com/repos/OpenEMS/openems/releases/latest | awk -F\" '/browser_download_url.*openems-edge\.jar/{print $(NF-1)}' | xargs wget -O openems-edge.jar
  • Build the Docker Image in the current directory
docker build -t openems-edge .
  • Run the Docker Container
docker run --volume=$(pwd)/config:/etc/openems.d --volume=$(pwd)/data:/var/lib/openems --publish=8080:8080 openems-edge

I am by far no expert in Docker, so if there is anything incomplete or wrong with this guide, please provide feedback. Also I believe it might be a good idea to build official docker images in future via GitHub Actions, just like we create Release artifacts.

Regards,
Stefan

Hey there,
iā€™m also no Docker Expert, but i ran the Edge-Controller and the UI without Problemes in my own Docker-Environment. Iā€™ve used Docker-Compose so this may help:

version: ā€˜3ā€™
services:
openems-edge:
image: openjdk:11
container_name: openems-edge
restart: unless-stopped
volumes:
- ā€œ/opt/docker/appdata/openems:/dataā€
working_dir: /data
ports:
- 8080:8080
- 8074:8074
- 8075:8075
command: java -Dfelix.cm.dir=/data/edge_config -jar openems-edge.jar
openems-ui:
image: nginx:latest
container_name: openems-ui
restart: unless-stopped
volumes:
- ā€œ/opt/docker/appdata/openems/ui/nginx/default.conf:/etc/nginx/conf.d/default.confā€
- ā€œ/opt/docker/appdata/openems/ui/www:/usr/share/openems/wwwā€
ports:
- 80:80

Greetings
Richard

1 Like

Hi,

in my environment iā€™m using traefik with openems and influxdb. Maybe this code is helpful for someone.

version: ā€œ3ā€

services:
openems_edge:
image: openjdk:11
container_name: openems-edge
restart: always
networks:
- proxy
ports:
- ā€œ8080:8080ā€
- ā€œ8084:8084ā€
- ā€œ8085:8085ā€
volumes:

  - /storage/Config/Openems:/data
working_dir: /data
command: java -Dfelix.cm.dir=/data/openems.d -jar openems.jar

influxdb2:
image: influxdb:latest
container_name: openems-influxdb
restart: always
networks:
- proxy
ports:
- ā€œ8086:8086ā€
volumes:
- /storage/InfluxData:/var/lib/influxdb2

openems_nginx:
image: nginx:latest
container_name: openems-ui
volumes:
- /storage/Config/Openems/ui:/usr/share/nginx/html
- /storage/Config/Openems/nginx:/etc/nginx
networks:
- proxy
restart: always
labels:
- ā€œtraefik.enable=trueā€
- ā€œtraefik.docker.network=proxyā€
# Https (Errorpages have to be handle in /nginx/conf.d/default.conf ā†’ ā€œerror_page 404 /index.html;ā€)
- ā€œtraefik.http.routers.openems-secure.entrypoints=websecureā€
- ā€œtraefik.http.routers.openems-secure.rule=Host(openems.example.de)ā€
- ā€œtraefik.http.services.openems-service.loadbalancer.server.port=80ā€
# Websocket
- ā€œtraefik.http.routers.openems-ws.entrypoints=websecureā€
- ā€œtraefik.http.routers.openems-ws.rule=Host(openems.example.de) && Path(/websocket)ā€
- ā€œtraefik.http.routers.openems-ws.service=ws-openems-service@fileā€

networks:
proxy:
external: true

Best regards
Christian

Hi Stefan et al.,
according to your instructions I installed openems-edge in a docker container which worked pretty good. Thank you for that.
Unfortunately I receive a bunch of Exceptions from java side I donā€™t understand (itā€™s to much). Maybe you, or someone else can point me to the direction what to do. Seems that Iā€™m missing some dependencies that I do not see at first glance but it might have something to do with apache felix framework since it occurs many times?!? The original log is even longer but since restriction to 12000 characters I copied only the first lines.
Best regards and thank you in advance
Christian

docker run --volume=$(pwd)/config:/etc/openems.d --volume=$(pwd)/data:/var/lib/openems --publish=8080:8080 openems-edge
org.ops4j.pax.logging.pax-logging-api [org.ops4j.pax.logging.internal.Activator] INFO : Enabling Java Util Logging API support.
org.ops4j.pax.logging.pax-logging-api [org.ops4j.pax.logging.internal.Activator] INFO : Enabling SLF4J API support.
org.ops4j.pax.logging.pax-logging-api [org.ops4j.pax.logging.internal.Activator] INFO : Enabling Apache Commons Logging API support.
org.ops4j.pax.logging.pax-logging-api [org.ops4j.pax.logging.internal.Activator] INFO : Enabling JULI Logger API support.
org.ops4j.pax.logging.pax-logging-api [org.ops4j.pax.logging.internal.Activator] INFO : Enabling Avalon Logger API support.
org.ops4j.pax.logging.pax-logging-api [org.ops4j.pax.logging.internal.Activator] INFO : Enabling JBoss Logging API support.
org.ops4j.pax.logging.pax-logging-api [org.ops4j.pax.logging.internal.Activator] INFO : Enabling Log4J v1 API support.
org.ops4j.pax.logging.pax-logging-api [org.ops4j.pax.logging.internal.Activator] INFO : Enabling Log4J v2 API support.
org.ops4j.pax.logging.pax-logging-api [log4j2] INFO : Initializing Log4j2 using default configuration
org.ops4j.pax.logging.pax-logging-api [log4j2] INFO : Scanning for classes in '/org/ops4j/pax/logging/log4j2/internal/bridges/' matching criteria annotated with @Plugin
org.ops4j.pax.logging.pax-logging-api [log4j2] INFO : Scanning for classes in '/org/apache/logging/log4j/layout/template/json/' matching criteria annotated with @Plugin
org.ops4j.pax.logging.pax-logging-api [log4j2] INFO : Scanning for classes in '/org/apache/logging/log4j/layout/template/json/resolver/' matching criteria annotated with @Plugin
org.ops4j.pax.logging.pax-logging-api [log4j2] INFO : Scanning for classes in '/org/apache/logging/log4j/layout/template/json/util/' matching criteria annotated with @Plugin
org.ops4j.pax.logging.pax-logging-api [log4j2] INFO : Log4J2 configured using default configuration.
org.ops4j.pax.logging.pax-logging-log4j2 [org.ops4j.pax.logging.spi.support.EventAdminConfigurationNotifier] INFO : Sending Event Admin notification (configuration successful) to org/ops4j/pax/logging/Configuration
org.ops4j.pax.logging.pax-logging-log4j2 [org.ops4j.pax.logging.spi.support.EventAdminConfigurationNotifier] INFO : Sending Event Admin notification (configuration successful) to org/ops4j/pax/logging/Configuration
ERROR: Bundle io.openems.edge.application [10] Error starting jar/io.openems.edge.application.jar (org.osgi.framework.BundleException: Unable to resolve io.openems.edge.application [10](R 10.0): missing requirement [io.openems.edge.application [10](R 10.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.types)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.application [10](R 10.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.types)(version>=1.0.0)(!(version>=2.0.0)))])
org.osgi.framework.BundleException: Unable to resolve io.openems.edge.application [10](R 10.0): missing requirement [io.openems.edge.application [10](R 10.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.types)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.application [10](R 10.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.types)(version>=1.0.0)(!(version>=2.0.0)))]
	at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4398)
	at org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1566)
	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:297)
	at java.base/java.lang.Thread.run(Unknown Source)
ERROR: Bundle io.openems.common [9] Error starting jar/io.openems.common.jar (org.osgi.framework.BundleException: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17)) Unresolved requirements: [[io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))])
org.osgi.framework.BundleException: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17)) Unresolved requirements: [[io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))]
	at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4398)
	at org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1566)
	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:297)
	at java.base/java.lang.Thread.run(Unknown Source)
ERROR: Bundle io.openems.edge.battery.api [11] Error starting jar/io.openems.edge.battery.api.jar (org.osgi.framework.BundleException: Unable to resolve io.openems.edge.battery.api [11](R 11.0): missing requirement [io.openems.edge.battery.api [11](R 11.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.battery.api [11](R 11.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0)))])
org.osgi.framework.BundleException: Unable to resolve io.openems.edge.battery.api [11](R 11.0): missing requirement [io.openems.edge.battery.api [11](R 11.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.battery.api [11](R 11.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0)))]
	at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4398)
	at org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1566)
	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:297)
	at java.base/java.lang.Thread.run(Unknown Source)
ERROR: Bundle io.openems.edge.battery.bmw [12] Error starting jar/io.openems.edge.battery.bmw.jar (org.osgi.framework.BundleException: Unable to resolve io.openems.edge.battery.bmw [12](R 12.0): missing requirement [io.openems.edge.battery.bmw [12](R 12.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.battery.bmw [12](R 12.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0)))])
org.osgi.framework.BundleException: Unable to resolve io.openems.edge.battery.bmw [12](R 12.0): missing requirement [io.openems.edge.battery.bmw [12](R 12.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.battery.bmw [12](R 12.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0)))]
	at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4398)
	at org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1566)
	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:297)
	at java.base/java.lang.Thread.run(Unknown Source)
ERROR: Bundle io.openems.edge.battery.bydcommercial [13] Error starting jar/io.openems.edge.battery.bydcommercial.jar (org.osgi.framework.BundleException: Unable to resolve io.openems.edge.battery.bydcommercial [13](R 13.0): missing requirement [io.openems.edge.battery.bydcommercial [13](R 13.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.battery.bydcommercial [13](R 13.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0)))])
org.osgi.framework.BundleException: Unable to resolve io.openems.edge.battery.bydcommercial [13](R 13.0): missing requirement [io.openems.edge.battery.bydcommercial [13](R 13.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.battery.bydcommercial [13](R 13.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0)))]
	at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4398)
	at org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1566)
	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:297)
	at java.base/java.lang.Thread.run(Unknown Source)
ERROR: Bundle io.openems.edge.battery.fenecon.commercial [14] Error starting jar/io.openems.edge.battery.fenecon.commercial.jar (org.osgi.framework.BundleException: Unable to resolve io.openems.edge.battery.fenecon.commercial [14](R 14.0): missing requirement [io.openems.edge.battery.fenecon.commercial [14](R 14.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.battery.fenecon.commercial [14](R 14.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0)))])
org.osgi.framework.BundleException: Unable to resolve io.openems.edge.battery.fenecon.commercial [14](R 14.0): missing requirement [io.openems.edge.battery.fenecon.commercial [14](R 14.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.battery.fenecon.commercial [14](R 14.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0)))]
	at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4398)
	at org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1566)
	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:297)
	at java.base/java.lang.Thread.run(Unknown Source)
ERROR: Bundle io.openems.edge.battery.fenecon.home [15] Error starting jar/io.openems.edge.battery.fenecon.home.jar (org.osgi.framework.BundleException: Unable to resolve io.openems.edge.battery.fenecon.home [15](R 15.0): missing requirement [io.openems.edge.battery.fenecon.home [15](R 15.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.battery.fenecon.home [15](R 15.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0)))])
org.osgi.framework.BundleException: Unable to resolve io.openems.edge.battery.fenecon.home [15](R 15.0): missing requirement [io.openems.edge.battery.fenecon.home [15](R 15.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.battery.fenecon.home [15](R 15.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0)))]
	at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4398)
	at org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1566)
	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:297)
	at java.base/java.lang.Thread.run(Unknown Source)
org.osgi.framework.BundleException: Unable to resolve io.openems.edge.battery.soltaro [16](R 16.0): missing requirement [io.openems.edge.battery.soltaro [16](R 16.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.battery.soltaro [16](R 16.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0)))]
ERROR: Bundle io.openems.edge.battery.soltaro [16] Error starting jar/io.openems.edge.battery.soltaro.jar (org.osgi.framework.BundleException: Unable to resolve io.openems.edge.battery.soltaro [16](R 16.0): missing requirement [io.openems.edge.battery.soltaro [16](R 16.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.battery.soltaro [16](R 16.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0)))])
	at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4398)
	at org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1566)
	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:297)
	at java.base/java.lang.Thread.run(Unknown Source)
org.osgi.framework.BundleException: Unable to resolve io.openems.edge.batteryinverter.api [17](R 17.0): missing requirement [io.openems.edge.batteryinverter.api [17](R 17.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.batteryinverter.api [17](R 17.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0)))]
	at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4398)ERROR: Bundle io.openems.edge.batteryinverter.api [17] Error starting jar/io.openems.edge.batteryinverter.api.jar (org.osgi.framework.BundleException: Unable to resolve io.openems.edge.batteryinverter.api [17](R 17.0): missing requirement [io.openems.edge.batteryinverter.api [17](R 17.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.batteryinverter.api [17](R 17.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0)))])

	at org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1566)
	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:297)
	at java.base/java.lang.Thread.run(Unknown Source)
ERROR: Bundle io.openems.edge.batteryinverter.kaco.blueplanetgridsave [18] Error starting jar/io.openems.edge.batteryinverter.kaco.blueplanetgridsave.jar (org.osgi.framework.BundleException: Unable to resolve io.openems.edge.batteryinverter.kaco.blueplanetgridsave [18](R 18.0): missing requirement [io.openems.edge.batteryinverter.kaco.blueplanetgridsave [18](R 18.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.batteryinverter.kaco.blueplanetgridsave [18](R 18.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0)))])
org.osgi.framework.BundleException: Unable to resolve io.openems.edge.batteryinverter.kaco.blueplanetgridsave [18](R 18.0): missing requirement [io.openems.edge.batteryinverter.kaco.blueplanetgridsave [18](R 18.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.batteryinverter.kaco.blueplanetgridsave [18](R 18.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0)))]
	at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4398)
	at org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1566)
	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:297)
	at java.base/java.lang.Thread.run(Unknown Source)
org.osgi.framework.BundleException: Unable to resolve io.openems.edge.batteryinverter.refu88k [19](R 19.0): missing requirement [io.openems.edge.batteryinverter.refu88k [19](R 19.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.batteryinverter.refu88k [19](R 19.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0)))]
	at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4398)
	at org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1566)
	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:297)
	at java.base/java.lang.Thread.run(Unknown Source)
ERROR: Bundle io.openems.edge.batteryinverter.refu88k [19] Error starting jar/io.openems.edge.batteryinverter.refu88k.jar (org.osgi.framework.BundleException: Unable to resolve io.openems.edge.batteryinverter.refu88k [19](R 19.0): missing requirement [io.openems.edge.batteryinverter.refu88k [19](R 19.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.batteryinverter.refu88k [19](R 19.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0)))])
ERROR: Bundle io.openems.edge.batteryinverter.sinexcel [20] Error starting jar/io.openems.edge.batteryinverter.sinexcel.jar (org.osgi.framework.BundleException: Unable to resolve io.openems.edge.batteryinverter.sinexcel [20](R 20.0): missing requirement [io.openems.edge.batteryinverter.sinexcel [20](R 20.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.batteryinverter.sinexcel [20](R 20.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0)))])
org.osgi.framework.BundleException: Unable to resolve io.openems.edge.batteryinverter.sinexcel [20](R 20.0): missing requirement [io.openems.edge.batteryinverter.sinexcel [20](R 20.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve io.openems.common [9](R 9.0): missing requirement [io.openems.common [9](R 9.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=17))] Unresolved requirements: [[io.openems.edge.batteryinverter.sinexcel [20](R 20.0)] osgi.wiring.package; (&(osgi.wiring.package=io.openems.common.exceptions)(version>=1.0.0)(!(version>=2.0.0)))]
	at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4398)
	at org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1566)
	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:297)
	at java.base/java.lang.Thread.run(Unknown Source)

Hi chrizztus, welcome on board!

Are you able to run the ā€œopenems.jarā€ file outside of the Docker container - e.g. using java -jar openems.jar?

You could try to use the ā€˜officialā€™ openems-edge.jar from the latest Release for a test: Releases Ā· OpenEMS/openems Ā· GitHub

How are you building your jar file? From command line or from Eclipse IDE? (see Build OpenEMS Edge :: Open Energy Management System)

Regards,
Stefan

Hi chrizztus, welcome on board!

Hi and thanks for welcoming me

Are you able to run the ā€œopenems.jarā€ file outside of the Docker container - e.g. using java -jar openems.jar?

Honestly Iā€™m not a huge fan of having java runtime on my system, so in order to keep it clean I wanted to test the containerized approach. Can you (or someone else) confirm that the Dockerfile from your instructions builds and starts correctly?

You could try to use the ā€˜officialā€™ openems-edge.jar from the latest Release for a test: Releases Ā· OpenEMS/openems Ā· GitHub
How are you building your jar file? From command line or from Eclipse IDE? (see Build OpenEMS Edge :: Open Energy Management System)

I didnā€™t yet compile the project with Eclipse. Instead I wanted to try the latest build from the github release page you mentioned. Without luck so far :-/

Try to update the Dockerfile from @stefan.feilmeier. Since we upgraded Java to version 17 during the last months, try to adjust the java version.

Then you do

$ docker build -t openems .

to build the image and do

$ docker run --detach -p 8080:8080 openems

Now you should be able to open http://localhost:8080/system/console/configMgr and get the Apache Felix Web Console.

Let us know it that works for you!

Best,
Lorant

1 Like

I am trying to dockerize the Edge App as well.

Without dockering i used to run the JAR file in Windows Terminal. And every time i restarted the EMS, it automatically read the config from c:/openems/config (as programmed to do here) :

Additionally i have also created External LOG files to store the warning and error. See my post here: OpenEMS export fehler + Speichern von Logs als externe Dateien

So in order to make sure that my dockerized Edge App could also read and edit the same config file and log files, i created volumes in the docker file:

VOLUME "C:\BIFLOW_LOGS\DEBUG" "C:\BIFLOW_LOGS\ERRORS" "C:\BIFLOW_LOGS\WARNINGS" "C:\openems\config"

I can see in the Docker desktop that the Edge App container is running at port 8080 and the log files are being updated. But for some reason the config data in ā€œc:\openems\confgā€ is not being read and the EMS basically runs as a completely new start.

I am not able to figure out where i am making a mistake.

If i stop my container and let the jar file run back again in windows terminal the config is read, but not through the container.

Would really appreciate some help here.

Edit 1:
The command i am using to run the jar is as follows

CMD [ "java", "-jar", "-Dfelix.cm.dir=c:/openems/config/" , "-Dopenems.data.dir=c:/openems/data", "/openems-edge.jar" ]

Regards
Laksh

Hi,
you can change the command to execute the jar file to point to the right location.
For example you can change the CMD line to the following and mount the config directories according it:

CMD [ "java", "-jar", "-Dfelix.cm.dir=/etc/openems/config/" , "-Dopenems.data.dir=/etc/openems/data", "/openems-edge.jar" ]

Hope it is helpful to you.
Best

2 Likes

Hello,

I understood what i was doing wrong here. I was correct in providing the volumes details as well as the CMD, but the problem was that the volume was created with a random name in etc/data/ā€¦ Thus while executing the config in my C drive was not correctly mounted. I later learnt about ā€œNamed volumesā€ in docker container. This solved my problem. following is my new compose file:

version: '3.4'
services:
  biflowemsmain:
    volumes:
      # config file 
      - "c:/openems/config:/etc/openems/config/:rw"
      # data file 
      - "c:/openems/data:/etc/openems/data:rw"
    image: biflowemsmain
    container_name: openems-edge
    restart: always
    build:
      context: .
      dockerfile: ./Dockerfile
    ports:
      - 8080:8080

then my execution command is:

CMD [ "java", "-jar", "-Dfelix.cm.dir=/etc/openems/config/" , "-Dopenems.data.dir=/etc/openems/data", "/openems-edge.jar" ]

so here the mounted C drive config is taken into account and updated accordingly.

Regards
Laksh