As a current workaround, it is possible to modify the command at runtime:
docker run -it -p 8080:8080 openchargingnetwork/ocn-node:1.1.0-rc1 java -jar ./libs/ocn-node-1.1.0-rc1.jar
Additional thoughts
To avoid issues like this it is perhaps worth removing the version number from the artifact filename. To identify the version of a node, an endpoint could be added which reads from the version number set in the Gradle build script.
Original report by Adam Staveley (Bitbucket: [Adam Staveley](https://bitbucket.org/Adam Staveley), GitHub: adamstaveley).
The image with tag “1.1.0-rc1”, available at https://hub.docker.com/r/openchargingnetwork/ocn-node, does not include the correct command.
Steps to reproduce
As shown on https://hub.docker.com/layers/openchargingnetwork/ocn-node/1.1.0-rc1/images/sha256-8ae4a2ef5443fb3627a7309f7b47e069c8793f01af6d681f65a0c3f5cf0e911a?context=explore, the image tries to run the JAR file for version 1.0, rather than 1.1.0-rc1. This results in an error stating the file cannot be accessed.
How to Fix
The develop branch’s Dockerfile is the culprit: https://bitbucket.org/shareandcharge/ocn-node/src/develop/Dockerfile. The command line should be changed from:
to:
As a current workaround, it is possible to modify the command at runtime:
Additional thoughts
To avoid issues like this it is perhaps worth removing the version number from the artifact filename. To identify the version of a node, an endpoint could be added which reads from the version number set in the Gradle build script.