How to Run IBM Domino Server in Docker Container

In my previous post I wrote that I had started to get acquainted with Docker. I have already used some containers in production (for example, GitLab and swagger editor). And now I get interested if it is possible to run IBM Domino server in container. At my work some Notes developers use dev instance of Domino server, but there is a problem that instance works on the simple PC. Computer is rather powerful, but I would like to move this instance to a normal server with higher reliability and without power interruption. It would seem nothing’s easier. Just ask the admins to deploy a virtual machine and move the server there. But it’s not all as easy as it sounds in a big enterprise. There are resources, budgets and agreements. Whole this bureaucracy is so boring:(

But let that pass:) So we have a task to launch Domino in Docker. At first we ask Google. And it turned that good people have already done it for us. Thanks to Matteo Bisi and Daniele Vistalii. They prepared a great presentation about how to launch Domino in Docker. I have played with their Dockerfile and decided to improve it a  little. Main issue was about a size of final image. Below on the picture it is highlighted with red color the image of Domino 9.0.1 FP7 which I made on the ground of Daniele’s presentation. The image after my changes is highlighted with orange color and finally the image for production is highlighted with blue color.

1_images

2. So below I show a tree of folders for images creating:

2_tree

  • domino901 — folder for server installation 9.0.1 without fix packs
  • domino901_fp7 — folder for Image creation with FP7 which based on an image of basic server
  • domino901fp7 — one Image of Domino  9.0.1 with FP7. Size of this image is the smallest one.
  • domino901_setup — Image creation for server instance
  • software — folder with Domino 9.0.1  and FP7 distributives

Why are there so many folders? Layer play a critical part in container technology. I can do an image with a basic server and then create images for different  fixpacks based on it. It is very handy for tests of new fix packs. Or, for example, you have some systems that should work with certain version of Domino.

3.  The reason why the image of collages is so big is that they used separate commands COPY and RUN for Domino installation.

COPY sw-repo/${dominopackagedir}/ /tmp/sw-repo/
RUN /bin/bash -c "/tmp/sw-repo/install -silent -options /tmp/sw-repo/unix_response.dat"
RUN rm /tmp/* -R

Instead of this I decided to do the most heavyweight operations in one command RUN. I created one more container with nginx for this that share static content from software folder. Now I can download Domino packages with the help of wget or curl in the image without COPY command.

Launch nginx container and check files download. By the way, it is one more advantage of containers. Truly speaking, I have never dealt with nginx up to that moment. And now I launch the container with one command and so fast, without overthinking with its installation and setting.

docker run --name software -p 7777:80 -v /home/vs/software:/usr/share/nginx/html:ro -d nginx

3_wget

untu02.local is an address of my virtual machine. It is written in /etc/hosts. Test is completed. Everything works. Let’s go on.

4. Let’s build Domino 9.0.1 image. I have necessary scripts for launch Domino (thanks to Daniel Nashed)  and answers file for silent domino installation in subfolder resources.

My Dockerfile

FROM ubuntu:14.04

ENV DOM_SCR=resources/initscripts
ENV DOM_CONF=resources/serverconfig

RUN apt-get update && \
 apt-get install -y nano && \
 apt-get install -y wget && \
 apt-get clean

RUN useradd -ms /bin/bash notes && \
 usermod -aG notes notes && \
 usermod -d /local/notesdata notes && \
 sed -i '$d' /etc/security/limits.conf && \
 echo 'notes soft nofile 60000' >> /etc/security/limits.conf && \
 echo 'notes hard nofile 80000' >> /etc/security/limits.conf && \
 echo '# End of file' >> /etc/security/limits.conf

COPY ${DOM_CONF}/ /tmp/sw-repo/serverconfig

RUN mkdir -p /tmp/sw-repo/ && \
 cd /tmp/sw-repo/ && \
 wget -q http://ubuntu02.local:7777/DOMINO_9.0.1_64_BIT_LIN_XS_EN.tar && \
 tar -xf DOMINO_9.0.1_64_BIT_LIN_XS_EN.tar &&\
 /bin/bash -c "/tmp/sw-repo/linux64/domino/install -silent -options /tmp/sw-repo/serverconfig/domino901_response.dat" && \
 cd / && \
 rm /tmp/* -R

RUN mkdir -p /etc/sysconfig/
COPY ${DOM_SCR}/rc_domino /etc/init.d/
RUN chmod u+x /etc/init.d/rc_domino && \
 chown root.root /etc/init.d/rc_domino
COPY ${DOM_SCR}/rc_domino_script /opt/ibm/domino/
RUN chmod u+x /opt/ibm/domino/rc_domino_script && \
 chown notes.notes /opt/ibm/domino/rc_domino_script
COPY ${DOM_SCR}/rc_domino_config_notes /etc/sysconfig/

As you can see package download, server installation and cleanup of temporary directory was made by one command RUN. This way we saved about 1 Gb.

Build the image:

docker build -t vs/domino:9.0.1 .

4_domino901

5. The image was building about 10 minutes on my computer.

5_domino901_end
6. Create the image with seventh fix packs in the same way

FROM vs/domino:9.0.1

ENV DOM_CONF=resources/serverconfig

COPY ${DOM_CONF}/ /tmp/sw-repo/serverconfig

ENV NUI_NOTESDIR /opt/ibm/domino/

RUN mkdir -p /tmp/sw-repo/ && \
 cd /tmp/sw-repo/ && \
 wget -q http://ubuntu02.local:7777/domino901FP7_linux64_x86.tar && \
 tar -xf domino901FP7_linux64_x86.tar &&\
 cd /tmp/sw-repo/linux64/domino && \
 /bin/bash -c "./install -script /tmp/sw-repo/serverconfig/domino901_fp7_response.dat" && \
 cd / && \
 rm /tmp/* -R

As you can see I create it on the ground of vs/domino:9.0.1 from previous step.

Launch building.

docker build -t vs/domino:9.0.1-fp7 .

6_0

I have a mistake on the picture. It’s because I wrote wrong base image in the Dockerfile.

7.  We will have image with Domino 9.0.1 FP7 in 3-5 min. Everything  is OK, except the size of image. It is too big. We can delete  /opt/ibm/domino/notes/90010/linux/data1_bck and save 244Mb, but let’s keep it.

6_1

8. After checking fix packs I decided to combine server and fix pack in one image:

FROM ubuntu:14.04

ENV DOM_SCR=resources/initscripts
ENV DOM_CONF=resources/serverconfig

#install nano & wget
RUN apt-get update && \
 apt-get install -y nano && \
 apt-get install -y wget && \
 apt-get clean

RUN useradd -ms /bin/bash notes && \
 usermod -aG notes notes && \
 usermod -d /local/notesdata notes && \
 sed -i '$d' /etc/security/limits.conf && \
 echo 'notes soft nofile 60000' >> /etc/security/limits.conf && \
 echo 'notes hard nofile 80000' >> /etc/security/limits.conf && \
 echo '# End of file' >> /etc/security/limits.conf

COPY ${DOM_CONF}/ /tmp/sw-repo/serverconfig
ENV NUI_NOTESDIR /opt/ibm/domino/

RUN mkdir -p /tmp/sw-repo/ && \
 cd /tmp/sw-repo/ && \
 wget -q http://ubuntu02.local:7777/DOMINO_9.0.1_64_BIT_LIN_XS_EN.tar && \
 tar -xf DOMINO_9.0.1_64_BIT_LIN_XS_EN.tar &&\
 /bin/bash -c "/tmp/sw-repo/linux64/domino/install -silent -options /tmp/sw-repo/serverconfig/domino901_response.dat" && \
 cd /tmp/sw-repo/ && \
 rm /tmp/sw-repo/linux64 -R && \
 wget -q http://ubuntu02.local:7777/domino901FP7_linux64_x86.tar && \
 tar -xf domino901FP7_linux64_x86.tar &&\
 cd /tmp/sw-repo/linux64/domino && \
 /bin/bash -c "./install -script /tmp/sw-repo/serverconfig/domino901_fp7_response.dat" && \
 cd / && \
 rm /tmp/* -R

RUN mkdir -p /etc/sysconfig/
COPY ${DOM_SCR}/rc_domino /etc/init.d/
RUN chmod u+x /etc/init.d/rc_domino && \
 chown root.root /etc/init.d/rc_domino
COPY ${DOM_SCR}/rc_domino_script /opt/ibm/domino/
RUN chmod u+x /opt/ibm/domino/rc_domino_script && \
 chown notes.notes /opt/ibm/domino/rc_domino_script
COPY ${DOM_SCR}/rc_domino_config_notes /etc/sysconfig/

Build the image:

docker build -t vs/domino:9.0.1fp7 .

7_0

9. The image builds in 13-15 minutes.

7_1

10. There are three our images. We can start Domino server from any of them.

8

11. But we create one more image where we open necessary ports and install entry point.

Dockerfile:

FROM vs/domino:9.0.1fp7

EXPOSE 25 80 443 1352

COPY resources/docker-entrypoint.sh /
RUN chmod 775 /docker-entrypoint.sh

USER notes
WORKDIR /local/notesdata
ENV LOGNAME=notes
ENV PATH=$PATH:/opt/ibm/domino/

ENTRYPOINT ["/docker-entrypoint.sh"]

docker-entrypoint.sh

#!/bin/bash

serverID=/local/notesdata/server.id

if [ ! -f "$serverID" ]; then
 /opt/ibm/domino/bin/server -listen 1352
else
 /opt/ibm/domino/rc_domino_script start
 /bin/bash
fi

Depending on there is or not  file server.id in the data catalogue I run remote server setting or just run the server. Pay attention that I run listener on 1352 port. It has been done to not open one more port 8585 in the container.

Build  image

docker build -t vs/domino_server:1.0 .

In a second we got the image from which we would launch the container.

9_server

12. Before we launch the container it needs to create volume where we will store /local/notesdata. This is persistent catalog that is stored apart from the container.

docker volume create --name=domino-sgn

Launch the container in interactive mode:

docker run -it -p 8080:80 -p 1352:1352 -p 8443:443 -p 2525:25 --name domino_sgn -v domino-sgn:/local/notesdata vs/domino_server:1.0

Pay attention to mapping of ports. Our container will be available by these ports

11_start_container
13. Catalog /local/notesdata. This data will remain even if the container is deleted.

10_volume
14.  In the result we have a interesting russian doll. I work with macOS Sierra with a virtual machine ubuntu 16.04 and inside it the container with ubuntu 14.04 and Domino 9.0.1 is launched.

Launch on more virtual machine with windows 7. I added ip of my linux server ubuntu02.local in hosts.

Further there is standard setting of Domino server.

12_windows
15.

13_D1
16.

13_D2
17.

13_D3
18.

13_D4
19.

13_D5
20.

13_D6
21.

13_D7
22.

13_D8
23.

13_D9
24.

13_D10
25.

13_D11
26.

13_D12
27. You can see the process of setting in a console. After the end of remote setting the listener stops and finishes the container’s work.

13_D13
28. See the list of containers.

14_status
29. Launch the container again:

docker start domino_sgn

And connect to the container:

docker attach  domino_sgn

As you can see we enter in the container with notes user and our work catalog /local/notesdata

We can launch the script:

rc_domino_script monitor

and see what is happing in Domino console.

15_domino_start
30. Server is working

16_domino_process
31. Let’s try to open a mail in web-browse and send a letter:

17_iNotes
32. Exit from Domino console and look at the list of process in the container:

18_top
33. And finally stop the server

rc_domino_script  stop

19_stop

On my mind we have succeeded except for SERVER CRASHED ON SHUTDOWN message :)

P.S. Here is a link to all my scripts: https://github.com/sharavara/domino901_docker

Comments are closed.