Sunday, April 9, 2017

Running my development environment in a Docker

This time, I want to achieve to run my dev env in a docker rather from the vmware with odoo inside. I started working last Friday on this issue. Seems that I can't run odoo with our code base because one of the requirement is to install Pika library which is not included with odoo 9 image.

I don't have any choice but to create my own image base from odoo 9 official image. But errors keep popping up one after another.

The latest error that I encounter is below:

standard_init_linux.go:178: exec user process caused "no such file or directory"

I found this link and let's see if it can solve this problem. :)
https://forums.docker.com/t/getting-panic-spanic-standard-init-linux-go-178-exec-user-process-caused-no-such-file-or-directory-red-while-running-the-docker-image/27318/4

Here we go again, execute the command.
docker build -t eg_postgresql .

Still the same error :( but anyway, at the bottom of the article there is a command called dos2unix which convert your windows code to unix format. hope it helps. cross finger....



I'm invisible.... the trick is that you don't need to change the #!/bin/bash into #!/bin/sh , just run dos2unix inside docker and the rest will do trick. 










just ls and you will see the file entrypoint.sh, its because we edit this under windows environment we must convert this file to unix format.











That's it... simple. hahaha. well I've done productive today.




So the day's has past and I'm busy at work. Now I'm going to build the docker file.


















so far so good...



first we run our postgresql database...

docker run -d -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=admin --name postgres9.3 -p 5432:5432 --restart=always postgres:9.3


and then run the odoo container...

docker run -it -p 8069:8069 --name odoo9 --link postgres9.3:db -t vbodoo

here, I add "-it" to show the log in terminal as I run my odoo back in ubuntu virtual machine. I can ctrl+c to shutdown the odoo server from there.

The only problem is that when I try to run the odoo again. I couldn't run the above command as it will going to have another instance container. I just want to run again the same container.

To do that, the answer is very simple... I spend a lot time figuring it out :(

docker start -i <container-id> 

That's it! just a simple command.




The Final One!
After some testing, I finally got it. The last issue that I have facing which took me so much time is that I would like my host volume will be on drive D: because first its a different partition and has a lot of space memory.

1. Open Oracle VM VirtualBox
2. Look for the default docker-machine
3. Click Settings and add drive D: in the shared folders.


That's it, in the docker terminal just add the new volume path like below

docker run -it -p 8069:8069 -v /d_drive/Lynard/development/svn/repo2:/mnt/extra-addons --link postgres9.3:db --name dev_odoo -t ls/odoo9

look closely on the d_drive which is the same name in the shared folders. Eureka!





No comments:

Post a Comment

free online comma separating tool

https://delim.co/#