Domino-docker explained – Part 6 : Creating your own customisations

In the previous part, I showed how to create a Domino container image with all the right fix packs, hotfixes and add-ons, like Verse, Traveler and Volt. A special case was the addition of the -borg switch, as Borg backup is not an HCL product, and it doesn’t make changes to the Domino installation, but to the operating system of the container. So what if you need to make these kinds of changes yourself? Add packages to the os installation. Add extra libraries to your Domino installation? That is the subject of this part.

As example for this part, I use a Domino extension that Daniel Nashed has written: Spamgeek. SpamGeek is a great tool to control spam flowing into your Domino server. It consists of a servertask and configuration databases. The newest version also supports Sender Policy Framework (SPF) for which it needs a Linux library, which can be installed by installing the libspf2 package through yum.

Again: domino_container

In part 4, I looked at the domino_container script and discussed the several commands you could use with this script. One of these commands was the build command, and it’s this command that can be used to create your own customisations.

To use this command, you need a build-directory. My build directory for installing Spamgeek looks like this:

build_image/
├── build.cfg
├── Containerfile
└── install_dir
    ├── extmgr
    ├── install.sh
    └── servertasks
        └── libnshsmtp.so

On machines where you installed the domino_container script, you can find a skeleton directory for this build directory in /opt/nashcom/startscript/build_image. You can either use this skeleton directory to define your custom image, or copy this skeleton directory to another location and work from there. The only condition to use your own customisations directory is that you changed into this directory before running the domino_container build command.

In the build.cfg you configure what the name should be of your image and on what base image you want to base your custom image. It’s good use to also add a description of your image and information of the maintainer.

# Build configuration for customer container images

IMAGE_NAME=martdj/domino
IMAGE_VERSION=12.0.1
IMAGE_LATEST_TAG=latest

IMAGE_LABEL_DESCRIPTION="Martijns Domino build with Spamgeek included"
IMAGE_LABEL_VENDOR="Martijn"
IMAGE_LABEL_MAINTAINER="Martijn de Jong <martdj-at-martdj.nl>"

BASE_IMAGE=hclcom/volt:latest

CONTAINER_FILE=Containerfile

#SOFTWARE_DIR=/local/software
#DOWNLOAD_FROM=http://192.168.99.42
#SPECIAL_CURL_ARGS="--insecure"
LINUX_UPDATE=no
BUILDAH_FORMAT=docker

The LINUX_UPDATE parameter defines whether on building your image, the OS of the container is also updated (yum update) or not. This means you can also use custom build option to just update the os of the container with your Domino image, though of course every update creates an extra layer, which means more space is used for the image.

The install.sh script is the key to any customisations you want to make. By default, this script will install any file it finds in the servertasks or extmgr in their proper directories. It also contains several functions to make it easier to script your own changes to the Domino image. Some of these functions:

Function nameUse case
install_binary “name”Installs an extra binary in the Domino program directory
install_file “source” “destination” “owner” “group” “permissions”Installs any file from your installation directory (/tmp/installdir) to a destination in your image
install_packageinstalls a package from the yum repositories
remove_packageremoves a package
standard functions in install.sh

So what does this mean for adding Spamgeek to my Domino container image? Spamgeek uses a library, libnshsmtp.so, which needs to be added to the Domino program directory, so I copy this file to the servertasks directory of install_dir (see my build directory above). Next, I need to install the libspf2 package, For this, I’ve added the line install_package "libspf2" at the end of the install.sh script like this:

# install servertasks
install_all_servertasks "$INSTALL_DIR/servertasks"

# install extmgrs
install_all_extmgr "$INSTALL_DIR/extmgr"

# install health check script
install_file "$INSTALL_DIR/domino_docker_healthcheck.sh" "/domino_docker_healthcheck.sh" root root 755

# install extra packages
install_package "libspf2"

# copy pre-start configuration
install_file "$INSTALL_DIR/docker_prestart.sh" "$DOMDOCK_SCRIPT_DIR/docker_prestart.sh" notes notes 770

header "Successfully completed installation!"

With these two changes, I can build my custom Domino image, by simply changing into my build_image directory and using the command:

domino_container build

If you see an error about the healthcheck not being supported for an OCI image, you need to set a parameter before running the domino_container build command:

export BUILDAH_FORMAT=docker

First remove the image that was created. Then do the export and rerun domino_container build

My result looks like this:

(Using config file /etc/sysconfig/domino_container)

Info: New Image Version available!


Building Image :  martdj/domino:12.0.1

STEP 1/10: FROM hclcom/volt:latest
STEP 2/10: ARG DownloadFrom=
--> ad798ee5694
STEP 3/10: ARG LINUX_UPDATE=
--> 7d7479db01d
STEP 4/10: ARG SPECIAL_CURL_ARGUMENTS=
--> 0c373c7af30
STEP 5/10: USER root
--> f04da7c6ccf
STEP 6/10: COPY install_dir /tmp/install_dir
--> 685ba405d6f
STEP 7/10: HEALTHCHECK --interval=60s --timeout=10s CMD /domino_docker_healthcheck.sh
--> 1d161406b95
STEP 8/10: RUN /tmp/install_dir/install.sh &&   rm -rf /tmp/install_dir

--------------------------------------------------------------------------------
Installing Domino related Files
--------------------------------------------------------------------------------

Installing '/opt/hcl/domino/notes/latest/linux/libnshsmtp.so'
CentOS Stream 8 - AppStream                     5.9 MB/s |  18 MB     00:03
CentOS Stream 8 - BaseOS                         16 MB/s |  16 MB     00:00
CentOS Stream 8 - Extras                        112 kB/s |  16 kB     00:00
CentOS Stream 8 - PowerTools                    3.2 MB/s | 3.8 MB     00:01
Extra Packages for Enterprise Linux 8 - x86_64  7.2 MB/s |  11 MB     00:01
Extra Packages for Enterprise Linux Modular 8 - 2.8 MB/s | 980 kB     00:00
Extra Packages for Enterprise Linux 8 - Next -  419 kB/s | 137 kB     00:00
Dependencies resolved.
================================================================================
 Package      Arch        Version                               Repo       Size
================================================================================
Installing:
 libspf2      x86_64      1.2.11-1.20210922git4915c308.el8      epel       74 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 74 k
Installed size: 154 k
Downloading Packages:
libspf2-1.2.11-1.20210922git4915c308.el8.x86_64 714 kB/s |  74 kB     00:00
--------------------------------------------------------------------------------
Total                                           294 kB/s |  74 kB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Installing       : libspf2-1.2.11-1.20210922git4915c308.el8.x86_64        1/1
  Running scriptlet: libspf2-1.2.11-1.20210922git4915c308.el8.x86_64        1/1
  Verifying        : libspf2-1.2.11-1.20210922git4915c308.el8.x86_64        1/1

Installed:
  libspf2-1.2.11-1.20210922git4915c308.el8.x86_64

Complete!

--------------------------------------------------------------------------------
Successfully completed installation!
--------------------------------------------------------------------------------

--> dd0bf37579a
STEP 9/10: EXPOSE 1352 80 110 143 389 443 636 993 995 63148 63149
--> 46b497ff550
STEP 10/10: USER notes
COMMIT martdj/domino:12.0.1

So now I have a custom Domino image, based on my latest hclcom/volt image, with both the library for Spamgeek and the libspf2 package included.

Conclusion

This was the last part of this series of articles on the Domino docker project. In this series, I showed how to work from building your first Domino docker image all the way from adding fix packs and add-ons to this image to adding your own customisations to your Domino image. Daniel Nashed put a lot of effort in the scripts which make working with Domino on Docker and creating Domino Docker images so easy. During the creation of these articles, we had a lot of contact regarding specifics in the scripts, what would be best practices etc, so although I did the writing, it was really a collaborative effort between Daniel and me.

I’ve been considering adding one part extra on how to push your own custom images to a central private Docker repository and pulling it on all your Domino servers and update them. Such an article is really more about Docker than about Domino though, and this kind of information can be found elsewhere I guess. If you would really like such an article, let me know.