Line 1: |
Line 1: |
| {{WIP box}} | | {{WIP box}} |
| + | {{Note box|Various configuration entries may be deprecated}} |
| + | |
| __TOC__ | | __TOC__ |
| [[File:Docker_design_conceptv0.1.png]] | | [[File:Docker_design_conceptv0.1.png]] |
Line 18: |
Line 20: |
| * May not effect or compromise default SME Server functionality, stability and security | | * May not effect or compromise default SME Server functionality, stability and security |
| | | |
| + | |
| + | ==Resources== |
| + | Possible resources and tools that can be used: |
| + | |
| + | ===Eixo::Docker perl library=== |
| + | a CPAN perl library for managing images and containers |
| + | http://search.cpan.org/~alambike/Eixo-Docker-1.103/lib/Eixo/Docker.pod |
| + | |
| + | https://github.com/alambike/eixo-docker |
| + | |
| + | The Eixo library interacts with Docker API via a TCP socket. By default Docker starts without a TCP socket attached, so we have to add it to the Docker service arguments in /etc/sysconfig/docker. The default port via which the Docker API communicates is 4243 but it can be any port. Below is an example /etc/sysconfig/docker file: |
| + | # /etc/sysconfig/docker |
| + | # |
| + | # Other arguments to pass to the docker daemon process |
| + | # These will be parsed by the sysv initscript and appended |
| + | # to the arguments list passed to docker -d |
| + | |
| + | other_args="-g /home/e-smith/files/docker -H 127.0.0.1:4243 -d" |
| | | |
| ==Options== | | ==Options== |
Line 33: |
Line 53: |
| ===B. Docker options=== | | ===B. Docker options=== |
| * TBA | | * TBA |
| + | * Docker cluster?? (Multiple SME Servers load balancing docker containers) |
| + | |
| | | |
| ===C. Image options=== | | ===C. Image options=== |
| * Linked containers | | * Linked containers |
| + | |
| + | To inspect an image and with what (networking) options it was constructed, one can inspect the image by: |
| + | docker inspect [imagename] |
| | | |
| | | |
| ==SME Databases== | | ==SME Databases== |
| ===Container options=== | | ===Container options=== |
| + | Container options can be passed to the container at 'boot' time. These options can include the following aspects: |
| + | * network (ports, port mapping) |
| + | * 'cpu' (load) |
| + | * memory allocated (size) |
| + | * Storage (mount paths, both inside container and (remote) host) |
| + | * Domain names (FQDN (sub)domains, Web server Aliases) |
| + | * Links to other containers (container wordpress automatically starts container MySQL) |
| + | |
| + | Unlike containers, images themselves do not carry this information, but only the exposed (open) ports. |
| + | |
| + | Hence the usage of SME Server db system to store preferred options per container. |
| + | |
| + | |
| Syntax: | | Syntax: |
| db docker_containers [name] | | db docker_containers [name] |
Line 122: |
Line 160: |
| | | |
| '''Install docker to your sme, be aware that you have to do it on a SME9 64 bit''' | | '''Install docker to your sme, be aware that you have to do it on a SME9 64 bit''' |
| + | original script : https://github.com/docker/docker/blob/master/contrib/mkimage-yum.sh |
| | | |
| Create your repository file and save it to /root/repo_file | | Create your repository file and save it to /root/repo_file |
Line 294: |
Line 333: |
| #yum -c "$yum_config" --installroot="$target" --setopt=tsflags=nodocs \ | | #yum -c "$yum_config" --installroot="$target" --setopt=tsflags=nodocs \ |
| #--setopt=group_package_types=mandatory -y groupinstall Core | | #--setopt=group_package_types=mandatory -y groupinstall Core |
− | | + | |
| ###here it is for testing purpose, you will build a pure centos base docker image (keep only one yum line of course) | | ###here it is for testing purpose, you will build a pure centos base docker image (keep only one yum line of course) |
| #yum -c "/root/repo_file" --installroot="$target" --setopt=tsflags=nodocs --setopt=group_package_types=mandatory -y groupinstall Core ###this line is to test and build a pure centos base in order to test | | #yum -c "/root/repo_file" --installroot="$target" --setopt=tsflags=nodocs --setopt=group_package_types=mandatory -y groupinstall Core ###this line is to test and build a pure centos base in order to test |
Line 301: |
Line 340: |
| ###here we take rpm in the most uptodate version | | ###here we take rpm in the most uptodate version |
| yum -c "/root/repo_file" --installroot="$target" --setopt=tsflags=nodocs --setopt=group_package_types=mandatory -y install e-smith\* smeserver\* | | yum -c "/root/repo_file" --installroot="$target" --setopt=tsflags=nodocs --setopt=group_package_types=mandatory -y install e-smith\* smeserver\* |
− | | + | |
− | <nowiki>###</nowiki>a bit of clean
| + | ###a bit of clean |
| yum -c "/root/repo_file" --installroot="$target" -y clean all | | yum -c "/root/repo_file" --installroot="$target" -y clean all |
| | | |