[SOLVED] - Docker Image: Is there a reference between build # and build time&date to know which build is in the current snapshot?

This is a general question how to find out which build # is in the snapshot image variant before downloading and starting?

I have waited some days to pull the snapshot image of 2.5 to be sure to have a certain build #. But when pulled and ran it I found out in the karaf console that I was on a lower build that I have expected. Waiting some more days I finally got to the intended level.

I would like to know if there is a way to find out which build # is in the current snapshot image before I pull it. As I am using the docker app on my synology for the pull process of the image which is UI based and automated. Hence the details are hidden. I can only choose for the snapshot version, distribution and platform.

Thanks for a short advise if and where this information is available.

Cheers
Justus

As you can see on the Jenkins openHAB-Distribution build page it has an openHAB2-Docker downstream project. So it will immediately start building the Docker containers when the new SNAPSHOT was build.

The Jenkins openHAB2-Docker build triggers a Travis CI build which builds/uploads the actual containers which usually takes about ~30 minutes. While it is building you can monitor the Travis CI build progress. After the Travis build has pushed a container to Docker Hub it may take a couple of minutes for it to be available.

So whenever there is a new openHAB SNAPSHOT build the new containers will always be available on Docker Hub within ~30 minutes.

If you still end up with an old container, you’ve probably not pulled the new container.

You can also verify the build number on the command line by pulling the new container and starting it with just printing the version.properties file content. The --rm switch will immediately remove the container after the command has finished.

$ docker run --rm --entrypoint /bin/bash openhab/openhab:snapshot -c "cat userdata/etc/version.properties"
openHAB Distribution Version Information
----------------------------------------
build-no        : Build #1482
online-repo     : https://openhab.jfrog.io/openhab/online-repo-snapshot/2.5

Repository        Version
----------------------------------------
openhab-distro  : 2.5.0-SNAPSHOT
smarthome       : 0.11.0-SNAPSHOT
openhab-core    : 2.5.0-SNAPSHOT
openhab1-addons : 1.14.0-SNAPSHOT
openhab2-addons : 2.5.0-SNAPSHOT
karaf           : 4.2.2

$ docker pull openhab/openhab:snapshot
snapshot: Pulling from openhab/openhab
e3b57c9babc3: Already exists 
ae00a2abba03: Already exists 
b10b7649bacc: Pull complete 
36567326f933: Pull complete 
b3dc14392f7c: Pull complete 
6080718050a8: Pull complete 
Digest: sha256:d2f16a77503164b5d1b857d6618e6c31c2c7d87f67af73e8c520155d247c86ce
Status: Downloaded newer image for openhab/openhab:snapshot

$ docker run --rm --entrypoint /bin/bash openhab/openhab:snapshot -c "cat userdata/etc/version.properties"
openHAB Distribution Version Information
----------------------------------------
build-no        : Build #1487
online-repo     : https://openhab.jfrog.io/openhab/online-repo-snapshot/2.5

Repository        Version
----------------------------------------
openhab-distro  : 2.5.0-SNAPSHOT
smarthome       : 0.11.0-SNAPSHOT
openhab-core    : 2.5.0-SNAPSHOT
openhab1-addons : 1.14.0-SNAPSHOT
openhab2-addons : 2.5.0-SNAPSHOT
karaf           : 4.2.2
1 Like

Hi Wouter,

I kindly appreciate your explanation. Clicking on your link shows me

from the Jenkins openhab build page …

This was the information I was looking for. One of the binding maintainers told me that his enhancements would be available in build #1487 which he thought should be the next one coming. But I pulled too early and got even #1484.
Now knowing about this list, I can match the build # with the build time and date. And with your explanation that the docker image build will be just initiated after the Jenkins build was successful I know when to pull my image to get the build # that I am looking for.

Thanks a lot!!!

1 Like