Creating Smaller Lucee (Light) Docker Images

Hi there!
Sorry for the shameless self-promotion but I did a blog post today that hopefully can help some people will find useful!
Since there are occasions that I need to make super tiny Lucee microservices this is how I make the docker image as slim as possible. If you have other suggestions, it would be great to hear them!

Check it out and let me know what you think:

7 Likes

Great stuff, Mark. I’d love to see more like this on Lucee-specific devops. It’s a journey I’m on currently and clear walk-thoughs like this really help.

1 Like

I shall try to post a bit more, I keep putting out fires and forget to write about how I put out a previous fire :smiley:

1 Like

You might get a bit more size reduction and enterprise enhanced security with freeBSD container, otherwise awesome sauce.

1 Like

Your post is really EXCELLENT!!!

3 Likes

Thank you Andreas! Very much appreciated!

I shall check it out! I thought the Alpine ones were pretty much the smallest?

The SD card images are the smallest but I found not much gain in terms of performance or time depending on how you are building the final image.

Which images are these by the way? Just so I can check out the docker images.

They are not on any public images, We moved off docker as its no longer in vogue, now its all azure images.

I can give you pointers on how to do it, which boils down to:
install freebsd
update freebsd
freebsd-update fetch
freebsd-update install
pkg update -f
install java::
pkg install openjdk11-11
install tomcat::
pkg install tomcat9-9
edit the file system for tomcat swap
pay close attemtion to the tomcat 9 installer end message, but its usually
vi /etc/fstab
add the following
fdesc /dev/fd fdescfs rw 0 0
proc /proc procfs rw 0 0

save and then mount the file system
mount -t fdescfs fdesc /dev/fd
mount -t procfs proc /proc

start tomcat
service tomcat9 start
verify tomcat is working
stop tomcat
service tomcat9 stop
install lucee.war or jar (depending on how you want to set it up)
edit your server.xml in tomcat to include cfc /m / l files
edit the permissions for tomcat to mask lucee permissions
test to make sure everything is working
optionally jail your lucee instance
make sure tomcat starts by editing the /etc/rc.config
service enable tomcat9

reboot and test
add docker / azure/ aws or other host environment items as needed

reboot and test
then add your chroot and lock that build down

then export the image usingw hat ever cloud tools you have or by natively doing

pkg install -y pv pigz
zpool create mybackupnameiswhomybackupnameiswhatthisisthediskname d1
zfs snapshot -r zroot@mybackupnameiswhomybackupnameiswhatthisisthediskname
zfs send -R zroot@mybackupnameiswhomybackupnameiswhatthisisthediskname |pigz|pv >/mybackupnameiswhomybackupnameiswhatthisisthediskname/cfdever.zfs.gz
1 Like

7 posts were split to a new topic: Open source licenses and large companies

A post was merged into an existing topic: Open source licenses and large companies