Sunday, April 2, 2017

Installing latest postgresql (9.6) and odoo (10)

I always trying to make things complicated like I have already installed postgres 9.3 and odoo 9 and its working fine but I like to install a newest version for both. This time the latest postgres (9.6 at this time of writing as well) as well as odoo (10).

First pull the postgres image. By not declaring which version, it will automatically pull the latest version which is 9.6.
docker pull postgres

(1st attempt)
Then run and and create the container.
docker run --name postgres9.6 -e POSTGRES_PASSWORD=password -p 5433:5432 postgres





















I'm not sure why the logs is showing, let's do it again with different command. But before I forgot, my other objective is to test whether we can run two postgres container in different port like 5433 and 5432.

(2nd attempt)
So I stop and delete the running container and run again with below command. I added the POSTGRES_USER=admin, just to standardize all. .. and voila. its runs
docker run --name postgres9.6 -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=admin -p 5433:5432 -d postgres



Final command:

docker run -d -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=admin --name postgres -p 5433:5432 --restart=always postgres


Since the latest postgres is compatible with latest pgadmin as well which is version 4. so I decided to run in docker too by pulling an image from https://hub.docker.com/r/fenglc/pgadmin4/.
docker pull fenglc/pgadmin4

Lastly, run the pgadmin4 container and link to postgres
docker run --name pgadmin4 --link postgres9.6:postgres -p 5050:5050 -d fenglc/pgadmin4
























EUREKA!


I'm still not finish yet, I'm too excited that I successfully run the postgres. Well, I actually I need to run the latest odoo as state in my subject but I need a break, I'm having lunch now at my desk. will continue for a while. Ciao!


Ok, let's go back to business.

First, get the latest odoo image.
docker pull odoo

Run the image and link to postgres
docker run -p 8070:8069 --name odoo10 --link postgres9.6:db -t odoo




























Whoah! That wasn't so hard. This time I changed the port to 8070 by changing the parameter -p 8070:8069 to have different port for my odoo10


I'm invinsible...



Updated: 16-May-2017

I just read this new article https://blog.codeship.com/ensuring-containers-are-always-running-with-dockers-restart-policy/ it quite good as he explains clearly.

I have made changes with below command:

docker run -d -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=admin -p 5433:5432 --name db --restart=always postgres


after running the postgresql, run the odoo.

docker run -p 8070:8069 --name odoo10 --link db:db -it odoo



No comments:

Post a Comment

free online comma separating tool

https://delim.co/#