ensuring the version of runwar in Docker Commandbox

In my Dockerfile I extract the Runwar directory from the commandbox server and put it into a smaller container just running Java.
The issue is that when Commandbox gets an update, the version of Runwar may change while using the same tag for the commandbox image.

Is there a way to choose my runwar version and path during the startup in my Dockerfile?

Not really, runwar is an internal dependency of CommandBox and, in theory, you should never have to worry about what it’s called or where it’s located. Overall, we should provide a better process for finalizing an image that doesn’t involve you having to guess the names and locations of jars.

That said, you can programmatically get the path to the jar which was used the last time the server started like so:

server info property=runwarJarPath

which you can then use to make your script dynamic.

Thank you for the quick response. I will take a pass at automating our script. Really appreciate your help.

Follow up question, just to make sure I’m understanding the ecosystem. As far as I can tell, Docker tags for official Commandbox images refer to the OS and the CFML vendor and version. But don’t refer to the version of Commandbox itself.
So if I choose a tag for Lucee5 for instance, when I pull it today, it could be a different version of Commandbox tomorrow if the new images have been constructed for a new release of Commandbox.

Doesn’t that go against the idea of reproduceable builds using Docker tags?

@jclausen can comment further, but those tags are defined as “the latest versions at the time the tag is made”. If you want to lock in your versions, then build your own custom docker file on top of the vanilla image. Think of the tag :lucee5 as you would :latest. But in this case, it’s effectively :lucee5-latest.

@Reuben The changelog lists all of the relevant changes to the image version.

If you need to pin to a version, then you can use the version number - which all images are tagged with. So, if today’s :latest is a good fit for you, then you could tag it permanently to:

ortussolutions/commandbox:3.13.4

And it would be pinned with CommandBox 6.2 and the current image conventions - and Runwar jar paths

You can also passing in a build arg to test on newer versions of the image before you bump the version.

I’ll look at making the example finalized image Dockerfile more dynamic to account for changes within CommandBox/Runwar

Again thank you for all the advice and tips. Really helpful.