Koozali.org: home of the SME Server

Docker on SME Server

guest22

Docker on SME Server
« on: October 10, 2014, 02:08:20 PM »
This is the place to discuss Docker on SME Server.

Please see: http://wiki.contribs.org/Docker

Offline michelandre

  • *
  • 261
  • +0/-0
Re: Docker on SME Server
« Reply #1 on: March 01, 2015, 07:13:33 AM »
Hi Hf,

Glad I found your contrib.

I saw that Stephdl is working on Docker too. Nice to have two great persons as you two working on Docker/SME.

I just started on Docker a few days ago.

I installed boot2docker.iso on a VirtualBox. Everything is working fine. I pulled centos-6.5 and it is working quite nice. I saved it in a tar file to transfer it to a sme-9 running Docker. But with the boot2docker running on a bare bone, there is no scp to copy it to the destination server. I do not have a hub yet...

The goal is to have boot2docker running images of SME-9, WordPess, Dolibarr, PostgreSQL, Odoo, and Python all working together. That should be a good thing for SME. After testing everything with Docker, I will write a small howto explaining what I did.

If I understand right, you did an image of a SME-9 on Docker. Will it be possible to have your sme9/6.5/55db4355a2de. It will save me a lot of time.

Michel-André

PS: I finally have Odoo working great on an SME-9 VM and on real hardware. I had some problems with PostgreSQL-9.4 but now it is working well. I wrote a small howto on that installation so other people can use it also.

guest22

Re: Docker on SME Server
« Reply #2 on: March 02, 2015, 02:56:45 PM »
Hi michcelandre,

I would love to see your work and test documented. Also the Odoo work. I tried that with using software collections.

Thanks!
guest

Offline michelandre

  • *
  • 261
  • +0/-0
Re: Docker on SME Server
« Reply #3 on: March 02, 2015, 03:11:39 PM »
Hi HF,

Here is the link for Odoo. In french but should be easy to follow the commands.
Installation: http://www.micronator.org/?page_id=1765
First steps: http://www.micronator.org/?page_id=1794

For Docker, I found out that my bare metal installation was not really an installation but just a ordinary live boot from the ISO CD as I left it in. I found out when I took it off and VirtualBox sait it can not find a valid OS. I found a video explaining the installation. I will try it soon.

Michel-André

Offline Xavier.A

  • ***
  • 104
  • +0/-0
Re: Docker on SME Server
« Reply #4 on: March 02, 2015, 11:48:14 PM »
@michelandre

Your Howtos are very interesting !

I don't know if you want to complete your work but there are some information you could add in your documents. Maybe you already know those links (sorry but the following links are in french) :

The french editors Eyrolles and Foucher are publishing manuals for students or for end users :

some docker OpenERP images :
It will be interesting to read your report if you succeed the installation of an OpenERP Docker images in SME.

Good continuation.
« Last Edit: March 02, 2015, 11:52:08 PM by Xavier.A »
“When the wise man points to the moon, the fool looks at the finger.”

Offline michelandre

  • *
  • 261
  • +0/-0
Re: Docker on SME Server
« Reply #5 on: March 03, 2015, 02:51:29 AM »
Hi Xavier,

Thank you, very good links. Especially: http://people.via.ecp.fr/~alexis/openerp/

*** ODOO
For now, I stopped everything on Odoo-8 as I found its total lack of documentation on version 8. Wikipedia says it has 2M users worldwide. Odoo-8 was out in september 2014 and we are in march 2015 and still no documentation yet. Awfull! Translation, a total mess - half English and half in another language. I never saw such a thing in all my years in computers... I had to translate base, procurement, purchase, sale, sale_stock, mail etc for fr_CA. I was lucky that some fr were half done... It is opensource but you have to pay for an update ( 6 to 7 to 8 to ...) of the database.

*** SME-9
- I know it is possible to install Odoo-8 on SME-9 without problems. It is possible to make an update on SME-9 and it doesn't interfere with Odoo and vice versa. User oddo is in /home/e-smith/files/users/; Python source in /root; odoo itself in .../Primary/html/odoo The regular backup should pick all up.
- For PostgreSQL it's a little bit different but I guess it will be easy to upgrade to SME-10 as it is easy to backup the database in Odoo.
- For Python, it is working in a virtual environement and doesn't interfere with SME-9. I am not a programmer so I don't exactly know how it is working but it is.

*** DOCKER
I prefer to work on Docker as it has so much potential. The goal is to have it working with SME. I would like to have only boot2docker as the governing OS for all the images, containers etc... I am still working on that part.

My problem is that I don't know yet how to build SME-9 as an image. When I find that, the rest should be easy. I will build the image the same way for PostgreSQL Python, and WordPress. Put all of them together in one container (in a good server hardware) and make them communicate with one another and finally write the documentation.

Any link on Docker image building for dummies ( web or video ) will be appreciated.

It might take me some time but I have some...

Michel-André

Offline ylluminate

  • *
  • 39
  • +0/-0
Re: Docker on SME Server
« Reply #6 on: March 04, 2015, 08:59:20 AM »
Appreciate the work going on to make Docker work with SME Server!

I am running into an interesting wall.  I have EPEL installed as per http://wiki.contribs.org/Epel#tab=For_SME_9_x

And I have tried to also install the RPM to enable it previously... however when I attempt to install `docker-io` I am never able to find the RPM via `yum`:
Code: [Select]
[root@server yum.repos.d]# yum install docker-io --enablerepo=epel
Loaded plugins: fastestmirror, smeserver
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: centos.mirrors.tds.net
 * epel: mirror.us.leaseweb.net
 * smeaddons: mirror.canada.pialasse.com
 * smeextras: mirror.canada.pialasse.com
 * smeos: mirror.canada.pialasse.com
 * smeupdates: mirror.canada.pialasse.com
 * updates: mirror.cogentco.com
No package docker-io available.
Error: Nothing to do

Any idea as to what may be going on here or what I can do to isolate why this package is not being found?

guest22

Re: Docker on SME Server
« Reply #7 on: March 04, 2015, 09:18:22 AM »
What is the output of 'db yum_repositories show epel'


Are you using 64-bit architecture, which is mandatory.

Offline ylluminate

  • *
  • 39
  • +0/-0
Re: Docker on SME Server
« Reply #8 on: March 04, 2015, 09:23:18 AM »
What is the output of 'db yum_repositories show epel'


Are you using 64-bit architecture, which is mandatory.

Ah, that's the problem.  This is `i686`.  Thanks for pointing that out as I did not realize that that would be an issue here.

Curious, is there a way to upgrade to 64-bit from i686 whilst keeping configs and installed pkgs (but changed to x64) intact?
« Last Edit: March 04, 2015, 09:24:56 AM by ylluminate »

guest22

Re: Docker on SME Server
« Reply #9 on: March 04, 2015, 09:41:39 AM »
Curious, is there a way to upgrade to 64-bit from i686 whilst keeping configs and installed pkgs (but changed to x64) intact?


A normal backup re-install 64 bit aand restore would do that. But not for the contribs only plain SME Server data and users.

Offline michelandre

  • *
  • 261
  • +0/-0
Re: Docker on SME Server
« Reply #10 on: March 04, 2015, 03:06:21 PM »
Hi all,

***** To make boot2docker permanent:
https://github.com/boot2docker/boot2docker/issues/391
@SvenDowideit Here is my steps:
1. First time to install boot2docker(v0.12.0) with CDROM:
a) $ dd if=/dev/cdrom of=/dev/sda
b) fdisk disk with 2 primary partitions:
$ sudo fdisk /dev/sda
$ n
$ p
$ 2
$ ENTER
$ ENTER
$ w
c) format sda2: $ sudo mkfs.ext4 /dev/sda2
d) mount into /mnt/: $ sudo mkdir -p /mnt/sda2 $ sudo mount /dev/sda2 /mnt/sda2
e) Add some private files into /mnt/sda2, like pulling some docker images, or other test files.
f) reboot.
2. Update to boot2docker v1.0.0 with CDROM, same steps as 1 a) b) , and then reboot, after rebooting, you will find the data added in /mnt/sda2 was still there.

***** SME-9 image
- create a new SME-9
- update
- tar /
- at the boot2docker machine, scp the tar (sme9-maj.tar) into the boot2docker machine

- import from the tar:
cat /mnt/sdb1/sme9-maj.tar | sudo docker import - sme9-maj:new

- show the images
root@boot2docker:/mnt/sdb1# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
sme9-maj            new                 c6973869e8f4        9 minutes ago       3.072 GB
root@boot2docker:/mnt/sdb1#

- start SME9-maj:new
root@boot2docker:/mnt/sdb1# docker run -i -t c6973869e8f4 sh

- It is possible to: ping, yum install... , etc.

** Problems
- no 2nd and 3rd network card
- no reboot command
- no signal-event...

At last boot2docker is permanent and I have a working SME-9 image

Michel-André

guest22

Re: Docker on SME Server
« Reply #11 on: March 04, 2015, 03:58:41 PM »
Michelandre,


can you please add your info to the wiki please?


Thanks,
guest


Offline michelandre

  • *
  • 261
  • +0/-0
Re: Docker on SME Server
« Reply #12 on: March 07, 2015, 07:41:49 AM »
Hi all,

Finally I wrote a small document on boot2docker. It is very preliminairy but it is a start.
http://www.micronator.org/?page_id=1826

It describes how to install boot2docker on a virtual machine:
- It is the only system running on that VM.
- How to boot it from the ISO.
- How to make it permanent so to be able to boot without the CD.
- How to add another disk to boot2docker as a scatch pad to store a future TAR file of an SME-9 so to be able to make an image of SME-9.

Next step: I will try to boot SME-9 VM with a live Linux CD, mount both "/" and "/boot" in /tmp then tar the whole system...

Help needed for the SME image:
1) How to make a regular tar.gz of a complete SME (both partitions: "/" and "/boot" in a single tar.gz file)?
2) Is it possible to make 2 tar.gz, make 2 images, and combine them in 1 container?
3) How to include the 2 NICs in the image?
4) How to make the 2 NIC communicate directly to the external world?
5) Is there another way to build the image?
6) etc...

To hf: I can not login to the docker wiki.

I can be reach directly through: http://www.micronator.org/?page_id=8

Conclusion: I am not a programmer, designer or developer but it is quite interesting to play with that boot2docker.

Michel-André


guest22

Re: Docker on SME Server
« Reply #13 on: March 07, 2015, 08:20:02 AM »
Help needed for the SME image:
1) How to make a regular tar.gz of a complete SME (both partitions: "/" and "/boot" in a single tar.gz file)?
2) Is it possible to make 2 tar.gz, make 2 images, and combine them in 1 container?
3) How to include the 2 NICs in the image?
4) How to make the 2 NIC communicate directly to the external world?
5) Is there another way to build the image?
6) etc...


http://wiki.contribs.org/Docker_design_concept#Create_a_SME_docker_Base_image


Quote
To hf: I can not login to the docker wiki.


http://wiki.contribs.org/Help:Contents#How_to_get_a_wiki_account.3F

Offline michelandre

  • *
  • 261
  • +0/-0
Re: Docker on SME Server
« Reply #14 on: March 09, 2015, 04:03:24 AM »
Hi all,

- I left boot2docker until I have a full working SME-9 image.

- I created a new SME-9 with VirtualBox.
- I Updated SME-9.
- I installed Docker according to:  http://wiki.contribs.org/Docker
  Docker status:  running... Reboot and still running. All looked OK.

- Then I started making the image according to: http://wiki.contribs.org/Docker_design_concept#Create_a_SME_docker_Base_image

- I run "/root/docker_images sme9".
- I received the following error, then the script stopped and returned to the console.
     + docker run -i -t sme9:sme9 echo success
     FATA[0001] Error response from daemon: Cannot start container 9ea6ac769afb197c463b5c2ec375f469c90ce3d9943be5d5b0606ce65e914aa0: exec: "echo": executable file not found in $PATH

- With "docker images" I see an image "sme9:sme9" with the name I gave when I run "/root/docker_images sme9".

- With Google, I found the same error but with "container containing static HTML files"; http://stackoverflow.com/questions/27816232/docker-running-a-data-container-from-scratch
- I can not see the relation between the 2 errors.

- In the script "/root/docker_images", I commented after: ###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\*

- In the script "/root/docker_images", I uncommented after: ###with the line below we take all from smeos, not really uptodate
yum -c "/root/repo_file" --installroot="$target" --setopt=tsflags=nodocs --setopt=group_package_types=mandatory -y install --disablerepo=* --enablerepo=smeos,smeextras e-smith\* smeserver\*

- I run the script again.
- 596 RPMs were downloaded. I took some time to finish...

$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
sme_no-update       6.5                 d45eefaf2990        2 minutes ago       854.3 MB

$ docker ps -a
CONTAINER ID        IMAGE                 COMMAND             CREATED             STATUS                     PORTS               NAMES
e4801fea6ad2        sme_no-update:6.5     "echo success"      2 minutes ago       Exited (0) 2 minutes ago                       elated_franklin

$docker run -i -t d45eefaf2990 bash
bash-4.1# cat /etc/e-smith-release
SME Server release 9.0
bash-4.1#

Victory, now I have a SME-9 image, not a perfect one but a real one.

Thank you so much Hf and Stephdl,

Michel-André