SoPlanning docker implementation using OpenSVC service facility.
Prerequisites :
1 linux system supporting docker, named host1.domain.com below
NIC eth0 is encapsulated in a bridge named br0 (see basic setup http://www.tldp.org/HOWTO/BRIDGE-STP-HOWTO/set-up-the-bridge.html , bridge is useful to connect docker containers directly on network, and no more through NAT to docker0 bridge)
ip address 10.11.12.13 is the ip of the docker environment. it is a different ip from the one assigned to the linux system, but in the same vlan of course.
1 LVM volume formatted as a Btrfs filesystem, with label = soplanning. 3 subvolumes are created. => lvcreate -L5G -n soplanning rootvg => mkfs.btrfs -L soplanning /dev/mapper/rootvg-soplanning => mount /dev/mapper/rootvg-soplanning /mnt => cd /mnt && for sub in root docker data; do btrfs subvolume create $sub; done && cd / && umount /mnt => mount -o defaults,subvol=data LABEL=soplanning /mnt && mkdir /mnt/mysql && umount /mnt
OpenSVC agent http://repo.opensvc.com => yum -y install http://repo.opensvc.com/rpms/current-1.8 # agent install => . /etc/profile.d/opensvc.sh # load opensvc env variables => svcmgr create -s soplanning.domain.com # create opensvc service => edit file /etc/opensvc/soplanning.domain.com.conf, and copy/paste the config section below
--------------- first line of config is just below this one --------------- [DEFAULT] service_type = PRD nodes = host1.domain.com autostart_node = host1.domain.com mode = hosted docker_data_dir = /soplanning/docker
[ip#0] ipdev = br0 ipname = 10.11.12.13 netmask = 255.255.255.0 gateway = 10.11.12.1 container_rid = container#0 tags = docker
[fs#0] dev = LABEL=soplanning mnt = /soplanning mnt_opt = defaults,subvol=root type = btrfs
[fs#1] dev = LABEL=soplanning mnt = /soplanning/docker mnt_opt = defaults,subvol=docker type = btrfs
[fs#2] dev = LABEL=soplanning mnt = /soplanning/data mnt_opt = defaults,subvol=data type = btrfs
[container#0] type = docker run_image = ubuntu:latest run_args = -i -t --net=none -v /etc/localtime:/etc/localtime:ro -h soplanning.domain.com run_command = /bin/bash
[container#1] type = docker run_image = mysql:latest run_args = -i -t --net=container:soplanning.domain.com.container.0 -v /etc/localtime:/etc/localtime:ro -v /soplanning/data/mysql:/var/lib/mysql:rw -e MYSQL_ROOT_PASSWORD=my_root_password -e MYSQL_DATABASE=soplanning -e MYSQL_USER=soplanning -e MYSQL_PASSWORD=soplanning
[container#2] type = docker run_image = opensvc/soplanning:latest run_args = -i -t --net=container:soplanning.domain.com.container.0 -v /etc/localtime:/etc/localtime:ro -e SVC_FQDN=soplanning.domain.com -e SVC_PORT=8080 -e SVC_DB_INSTANCE=soplanning -e SVC_DB_USERNAME=soplanning -e SVC_DB_PASSWORD=soplanning --------------- last line of config is just before this one ---------------
=> soplanning.domain.com print config # display the configuration in /opt/opensvc/etc/soplanning.domain.com.env => soplanning.domain.com start # start the overall service => soplanning.domain.com print status # display status for each ressource in the service => soplanning.domain.com stop # stop the overall service
During start of the service, the following action will be done by the OpenSVC agent :
One started, just go to http://soplanning.domain.com:8080/ and SoPlanning is ready to use.
=> wait a few minutes for mysql initialisation at first start => change the passwords to something more robust
More documentation is available here => https://docs.opensvc.com/agent.service.container.docker.html
Content type
Image
Digest
Size
227.2 MB
Last updated
over 9 years ago
docker pull opensvc/soplanning