Domino on Linux/Unix, Troubleshooting, Best Practices, Tips and more ...

alt

Daniel Nashed

Building applications in a build container

Daniel Nashed – 12 May 2024 08:17:00


Specially when developing for different target versions of an OS or an application a build container can be very helpful.
But build containers are also really helpful in larger teams when everyone should use the exact same build environment.


The Domino container project supports adding the Notes/Domino C-API SDK to the container image.
In case of Domino libnotes.so is required. Therefore compiling requires at least an installed Domino server with the same or newer version than the SDK version.


I built a Domino 14.0 FP1 image including C-API 14.0 and tagged it hclcom/domino:build.


For this blog post I am using the simple test program in the container projects automation test directory -->
https://github.com/HCL-TECH-SOFTWARE/domino-container/tree/main/testing
The directory is defined as a volume inside the container /build.

To ensure the binary can be written I am running the build using the root.
Alternative you can ensure that the 1000:1000 has write permissions in the directory to write the object and binary.


The following command starts a temporary build container and invokes make  (for better readability the line is split into separate lines).
make
finds the makefile and uses the compiler inside the container to compile
.

docker run -it --rm -w /build --entrypoint= -v $(pwd):/build -u 0
-e LOTUS=/opt/hcl/domino
-e Notes_ExecDirectory=/opt/hcl/domino/notes/latest/linux
-e LD_LIBRARY_PATH=/opt/hcl/domino/notes/latest/linux
-e INCLUDE=/opt/hcl/domino/notesapi/include
hclcom/domino:build make



Here is the break down of the command into it's components.


I have added the OpenSSL Development environment packages to the C-API development environment.
Most Domino add-on applications don't require OpenSSL. But adding this option I can use this container build environment also for native C/C++ applications which use OpenSSL.




run


Runs a new container based on the specified image


-it


The specified command is invoked interactively instead of detached (-d)


--rm


Once the command is executed and the container is stopped, remove it


-w /build


Switch to the build directory as the working directory to ensure the make command is executed in the right directory


--entrypoint=


The Domino container has an entrypoint script configured to start Domino automatically when the container is started.
Specifying an empty entrypoint, skips invoking the container image defined entrypoint.


-v $(pwd):/build


"Mount" the current directory into the container at /build.


-u 0


Run as root to ensure the output can be written. Can be omitted when user 1000:1000 has write permissions to this directory.


-e LOTUS=/opt/hcl/domino


Export the main LOTUS environment variable pointing to the server, which is used in makefiles.


-e Notes_ExecDirectory=/opt/hcl/domino/notes/latest/linux


Export the Domino binary directory location used in makefiles.


-e LD_LIBRARY_PATH=/opt/hcl/domino/notes/latest/linux


Set the LIB path to allow the linker and runtime to find the notes share objects


-e INCLUDE=/opt/hcl/domino/notesapi/include


Finally set the makefile INCLUDE directory to the C-API expected header file definition to find the header files.


hclcom/domino:build


Image name of the build container


make


finally the make command executed inside the container.


Links

    Archives


    • [HCL Domino]
    • [Domino on Linux]
    • [Nash!Com]
    • [Daniel Nashed]