How to put domino in a docker container and live happy. This are my slides from last IBM Connect 2016 lightning talk. Update will be available soon on my blogs, www.msbiro.net , blog.msbiro.net
AD-1172 Shipping Domino
How to Put Domino in a Container and Live Happy
Book of Recipes
Matteo Bisi, Daniele Vistalli @ Factor-y
About us
Matteo Bisi
• IBM Champions for Social Business (2014,2015,2016)
• IBM Certified Advanced System Administrator - Notes and Domino 9.0
• System engineer @ Factor-y S.r.l.
Daniele Vistalli
• CEO & CTO @ Factor-y S.r.l.
• R&D nerd with business focus
Docker and containers in 1 slide
Docker is a way to “package” your software in an image:
• File system
• System security (user/groups) & settings
• TCP Network (ports that needs to be reachable)
• Image inheritance is possible (incremental specialization)
Docker is a way to “ship & run” your software to other
systems:
• Start an “image” to get a container where your software runs
• Manage containers (start/stop/control etc)
• The container runs regardless of the actual (underlying) system
(VM, bare metal, etc)
Why package domino ? (developers edition)
Domino could be packaged to make developers happy
• Think about automated testing:
Start a clean server every time and test your software
Create “acceptance” environments in seconds
Keep an archive of images for every software release to perfrom
back-version debugging/testing (start a clean server in minutes)
• Think about saving time:
Use a standard image your admin has built, just fire it up
Why package domino ? (admin edition)
• Linux based servers ?
• Create images to support developers (standard deployment)
• Create images to ship & deploy your product in cloud with high
density
Pack the server, the software (NSFs and plugins) and deploy
Manage upgrades by just upgrading the image and attaching the
data volume (see volumes)
• Consolidate multiple servers on a single powerful machine but
maintain complete isolation
Program / data separation
Domino is born with clean separation, perfect for packaging
• Binary folder contains all server components
• NOTESDATA contains the “server instance”
We all know that you can often move a server by copy/paste
NOTESDATA + reinstall domino. THIS IS UNIQUE
• NOTES.INI = core settings in a controllable and manageable
place (no arcane binary or registry location)
File systems
A Domino server filesystem is well-defined and can be managed
• NotesData : all your databases and config files
• DAOS : if DAOS is enabled.. Attachments go here
• Transaction Logs : If transaction logs enabled, you find them in a well defined place
• FTIndexes : Full-text indexes can be placed in a specific location
• View rebuild : Temporary rebuild data can also be placed “somewhere”
This is perfect, Docker has “VOLUMES” a way to define filesystem attachments that “persist” even
if a container is stopped/destroyed and rebuilt.
VOLUMES allow to “mount” persistent filesystems to attach points defined in the IMAGE
description
Network services
• Domino is a network server
• Each service uses TCP ports
• To expose a port from a container to the “external” world you
need to declare those
• Plan for your needs, identify network ports and EXPOSE
EXPOSE 80 443 1352 (and eventually others)
Install and configuration automation
What about Domino setup and configuration ?
Once again we’re lucky
1. Domino server silent install
RUN /bin/bash -c "/tmp/sw-repo/install -silent -options /tmp/sw-
repo/unix_response.dat"
2. Recorded server configuration
/opt/ibm/domino/bin/server -silent /local/notesdata/playground.pds
/local/notesdata/playground.txt
What we need (installers, dockerfile)
1. Create a “build” directory where we place our “work files”
2. Put domino server installers
3. Put FP installers for domino server
4. Create a “dockerfile” aka “Image creation script”
5. Use docker CLI to create the image and build it
DockerFile anatomy
A “DockerFile” is a text file with docker commands, it
• Declares the “base image” to inherit from
• Copies files to the image filesystem
• Executes commands in the image to setup things
• Declares “VOLUME” mappings
• Declares ports to “EXPOSE”d.
Setup the environment (DockerFile 1/3)
# Select the base image to inherit from
FROM ubuntu:14.04
# Execute unix commands: add user, group and set limits
RUN adduser notes
RUN usermod -aG notes notes
RUN usermod -d /local/notesdata notes
RUN sed -i '$d' /etc/security/limits.conf
RUN echo 'notes soft nofile 60000' >> /etc/security/limits.conf
RUN echo 'notes hard nofile 80000' >> /etc/security/limits.conf
RUN echo '# End of file' >> /etc/security/limits.conf
Install domino (DockerFile 2/3)
# Copy our installers from our build directory to the image file
system
COPY sw-repo/domino901/ /tmp/sw-repo/
# Silent install domino/
RUN /bin/bash -c "/tmp/sw-repo/install -silent -options /tmp/sw-
repo/unix_response.dat"
Configure domino and cleanup (DockerFile 3/3)
# Prepare for configuration and run scripted configuration
ENV NUI_NOTESDIR /opt/ibm/domino/
RUN cp /tmp/sw-repo/*.id /local/notesdata/
RUN cp /tmp/sw-repo/playground.* /local/notesdata/
RUN su notes -c "cd /local/notesdata && /opt/ibm/domino/bin/server -silent /local/notesdata/playground.pds
/local/notesdata/playground.txt"
# Declare TCP ports to be exposed
EXPOSE 80 443 1352
# Clean up "tmp"
RUN rm -rf /tmp/*
--------------------------------------------
Now we build the image from the Unix Prompt:
Docker> docker build –f <dockerfilename>
Acknowledgements and Disclaimers
Availability. References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM
operates.
The workshops, sessions and materials have been prepared by IBM or the session speakers and reflect their own views. They are provided for informational
purposes only, and are neither intended to, nor shall have the effect of being, legal or other guidance or advice to any participant. While efforts were made to
verify the completeness and accuracy of the information contained in this presentation, it is provided AS-IS without warranty of any kind, express or implied.
IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this presentation or any other materials. Nothing contained in
this presentation is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the
terms and conditions of the applicable license agreement governing the use of IBM software.
All customer examples described are presented as illustrations of how those customers have used IBM products and the results they may have achieved.
Actual environmental costs and performance characteristics may vary by customer. Nothing contained in these materials is intended to, nor shall have the
effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results.