This has been replaced by the Auto-Deploy setup technology you can find here. The below may serve to find some helpful information in case of issues or deeper interest.
-----------------------------------------------------------------------------------------------------------------------------
Table of Contents |
---|
Before running through this guide, please make sure docker has been installed on the machine.
Docker Service Settings
Info |
---|
Client Version should be 1.10.3 Docker version 1.11 is currently not supported. You should also set storage driver setting to "devicemapper" |
...
Code Block | ||
---|---|---|
| ||
sudo apt-get remove docker-engine sudo reboot sudo rm -rf /var/lib/docker sudo apt-get install docker-engine |
...
Mac OS X or Windows
You can set it on docker machine create:
...
Code Block | ||
---|---|---|
| ||
docker-machine ssh default # Add to EXTRA_ARGS "--storage-driver=devicemapper" via: sudo vi /var/lib/boot2docker/profile exit docker-machine restart default |
Ubuntu 14.04
Code Block | ||
---|---|---|
| ||
# Docker installation sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D sudo nano /etc/apt/sources.list.d/docker.list # Add the following for Ubuntu trusty # deb https://apt.dockerproject.org/repo ubuntu-trusty main sudo apt-get update sudo apt-cache policy docker-engine sudo apt-get install linux-image-extra-$(uname -r) sudo apt-get install docker-engine=1.10.3-0~trusty # Permissions sudo usermod -aG docker <username> # Devicemapper sudo su echo 'DOCKER_OPTS="$DOCKER_OPTS --storage-driver=devicemapper"' >> /etc/default/docker service docker restart exit |
Ubuntu 16.04
UPDATE: Ubuntu 16.04 has started pushing docker 1.11.2 instead of 1.10.3, so the instructions below will probably not work. We recommend Ubuntu 14.04 is used for new installations, and that existing 16.04 installations do NOT perform a dist-upgrade until further notice.
Code Block | ||
---|---|---|
| ||
# Docker 1.10.3 installation sudo apt-get update sudo apt-get install docker.io # Please run docker version at this point to check that version is indeed 1.10.3! # Permissions sudo usermod -aG docker <username> # Devicemapper (notice the difference in 2nd line compared to 14.04) sudo su echo 'DOCKER_OPTS="--storage-driver=devicemapper"' >> /etc/default/docker service docker restart exit |
Login to Docker Hub
In order to be able to pull Docker images, we need login to the official Docker Hub first by simply using the following command:
Code Block |
---|
docker login |
New zero config docker setup
The below setup instructions are marked by (***) in the headline to indicate that this would be replaced by the new zero config setup as per this page. Where possible, please proceed with 1.9.7.1+ zero config containers. In the following passages you may still find useful add-on information.
(***) Pull DMS Docker images
DMS components have been packaged as three docker images:
...
Code Block |
---|
docker pull practiceinsight/dms_postgresql docker pull practiceinsight/dms_elasticsearch docker pull practiceinsight/dms_nuxeo_suite:1.9.5 |
(***) Run DMS Docker containers
Common rules for all containers
- Be sure, that user that launches docker container has write permissions on the mounting folders.
- The version of the Linux kernel version for Ubuntu host machine must be 3.16 or higher (Lower versions contain bug that causes impossibility to use 'su' command in container with '–net=host' option enabled)
If you want to restart docker containers on boot or in case of failure, you should add "–restart=always" option to the run command of container. The container will not be restarted if it's stopped with "docker kill/stop" command. Here is the example for elasticsearch:
Code Block docker run -p 9200:9200 -p 9300:9300 \ --restart=always \ -v /local_elasticsearch_data_folder:/data \ -v /etc/localtime:/etc/localtime:ro \ -v /etc/timezone:/etc/timezone:ro \ --net=host \ --name elastic -d practiceinsight/dms_elasticsearch
If you want to start Nuxeo container on boot then you need to add this option to elasticsearch and postgres containers also.
- On Windows mounting folders must be located in C:/Users, on Mac OS X - in /Users
When you are starting the container on Windows, folder must be mounted that way (two slashes are needed for the windows path):
Code Block -v //c/users/:/path_in_container
If you operate docker on Windows with Docker Quickstart Terminal, then execution of the docker exec commands on windows must be done in the docker machine command line. if the docker machine is called "default", then you can get access to it with:
Code Block docker-machine ssh default
If you operate docker with PowerShell then this step is unnecessary.
In order to sync timezone of docker containers with host machine, we should add the following parameters in docker run command:
Code Block language bash -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro
Further to this, you must make sure the
/etc/localtime
and/etc/timezone
files are configured correctly:/etc/timezone
file contains as a string selected from timezone db https://en.wikipedia.org/wiki/List_of_tz_database_time_zones./etc/localtime
file is linked to correct file from/usr/share/zoneinfo/
Further reading: http://www.thegeekstuff.com/2010/09/change-timezone-in-linux/
Run DMS PostgreSQL container on Windows or Mac OS X
Requirements to run:
- PostgreSQL backup folder must be mounted.
- Port 5432 must be exposed.
...
Code Block |
---|
docker exec -it postgres rm -f /etc/backup_enabled |
(***) Run DMS PostgreSQL container on Linux
DMS Postgresql for Linux is a container that is similar to a WinMac one, but all the data files of the postgresql are located in the folder of host machine. All the scripts for the WinMac container are working here.
...
When we re-import Postgres data, in order to avoid data conflicts, we should stop the running Postgres container, remove the docker container, remove the postgres data folder, and launch a new Postgres docker container.
(***) Run DMS ElasticSearch container
Requirements to run:
- ElasticSearch data folder must be mounted. Be sure, that user that launches docker container has write permissions on this folder. Can be empty.
- Ports 9200 and 9300 must be exposed.
...
Code Block |
---|
docker run -p 9200:9200 -p 9300:9300 \ -v /local_elasticsearch_data_folder:/data \ -v /etc/localtime:/etc/localtime:ro \ -v /etc/timezone:/etc/timezone:ro \ --net=host \ --name elastic -d practiceinsight/dms_elasticsearch |
(***) Run DMS Nuxeo suite container
Requirements to run:
- Ports 8080 and 9080 must be exposed.
- Nuxeo data folder must be mounted. Be sure, that user that launches docker container has write permissions on this folder. Can be empty.
- Folder containing pi-nuxeo.xml and nuxeo.conf must be mounted. nuxeo.conf.template will be added here on the first container launch.
- Folder containing windows fonts must be mounted to /home/nuxeo/.windows_fonts
...
Code Block |
---|
/var/log/nuxeo/server.log /var/lib/casebrowser/logs/casebrowser.log |
(***) Run DMS service container
Requirements to run:
- Docker socket must be mounted to the container
- HOSTNAME variable must be provided (will be used in generated email messages)
- EMAIL variable must be provided (will be used in generated email messages as a list of recipients)
...
This image contains 4 scripts: restart, cleanup, availability monitor and health check.
Configure write access for Patricia Users in Nuxeo GUI
- Log into Nuxeo GUI with administrator privileges.
- At top click "Workspace"; at left navigation bar click "Workspaces" directory; in documents area click the "Manage" tab for this folder.
- Under "Access rights" tab, below in "Add a new security rule" section, add group "members" with permission "write"; click "Grant permission".
- At top click "Admin"; at left navigation bar click "Users & Groups" directory; in tab "Groups" search for group "members" and click it to manage the group.
- Click tab edit and add "Patricia Users" as sub-group. Click "Save".
DEPRECATED – Clean up cron job
The following needs to be configured if no DMS service container is run The clean up cron job should be added to the cron on host of container.
...
Code Block | ||
---|---|---|
| ||
#!/bin/bash /usr/bin/logger "dms_cleanup.sh[$$] - Begin cleaning tmp directories" echo "--------------------" NUXEO=$(docker ps | grep "practiceinsight/dms_nuxeo_suite" | awk '{print $1}') echo $(date -u) "delete log files that are more than 7 days old" echo "$NUXEO" | xargs -I ID docker exec ID find /var/log/nuxeo /var/lib/casebrowser/logs -type f -a -ctime +7 -print -delete echo $(date -u) "delete ocr temp files" echo "$NUXEO" | xargs -I ID docker exec ID find /var/tmp/nuxeo /var/lib/nuxeo/server/tmp -type f -a -print -delete echo "$NUXEO" | xargs -I ID docker exec ID find /tmp -name '*.txt' -type f -a -print -delete echo "$NUXEO" | xargs -I ID docker exec ID find /tmp -name '*.tmp' -type f -a -print -delete echo "$NUXEO" | xargs -I ID docker exec ID find /tmp -name 'MIME*' -type f -a -print -delete echo "$NUXEO" | xargs -I ID docker exec ID find /tmp -name 'JODConv*' -type f -a -print -delete |
Restarting containers and services
You can restart a complete container (which will restart Nuxeo server and CaseBrowser by):
...