Minibox - a tiny commandbox docker image
By Pete Freitag
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
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.
Minibox - a tiny commandbox docker image was first published on April 16, 2020.
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