Pete Freitag Pete Freitag

Minibox - a tiny commandbox docker image

Updated on November 16, 2020
By Pete Freitag
coldfusionlinux

I have published a new project called minibox - it is a tiny docker image meant for running commandbox.

Testing it out

If you have docker installed you can simply run the following command:

docker run -it foundeo/minibox box version
Photo credit: sonnie hiles unsplash

This will run box version inside the container and output the version number of commandbox.

Making it small

This image is running on Alpine Linux with the Azul Zulu JVM, and the total size of the container is 78mb. There is room to trim this down a bit further, but the jvm itself takes up around 44mb, so it would be hard to get it significantly smaller.

Why is this useful?

The reason I built this was so that I could have a really small container to run in Continuous Integration builds. Where every second of build time is metered, you really don't want to spend a lot of time downloading large containers. From CI, I primarily use it for scanning CFML code for security issues in CI with Fixinator.

Usage with Fixinator

I built another image from minibox called: foundeo/fixinator. This container has the fixinator client installed on it (which runs on top of commandbox).

If your CI server lets you specify a docker container to run a build step from this makes a great choice for that. You can also just run it directly from the command line like this:

 docker run -it -v /local/folder:/code -e FIXINATOR_API_KEY=$FIXINATOR_API_KEY  foundeo/fixinator:latest box fixinator path=/code

Here it is a bit more complicated of a docker command because we are mapping a volume so that we can scan our code in the container. We are also passing in the FIXINATOR_API_KEY environment variables.

Can I run a CFML server from this container?

It was not really designed for running a CFML server from docker, though you certainly could and it would work. The Ortus Docker containers have a lot more tooling in them that make it generally more suited for that purpose.



docker commandbox fixinator

Minibox - a tiny commandbox docker image was first published on April 16, 2020.


Fixinator

The Fixinator Code Security Scanner for ColdFusion & CFML is an easy to use security tool that every CF developer can use. It can also easily integrate into CI for automatic scanning on every commit.


Try Fixinator

CFBreak
The weekly newsletter for the CFML Community


Comments

I just spotted this image! Looks amazing. How much are you still using it? Also, do you think you can do ARM builds of it?
by Mark Drew on 05/27/2022 at 3:35:42 PM UTC
@Mark - thanks, I am still using it and updating it frequently. I haven't looked into arm builds, it relies on the Azul Zulu JVM as the base image, so if that supported it then it would probably be possible.
by Pete Freitag on 07/13/2022 at 3:03:09 PM UTC