Showing posts with label docker-compose. Show all posts
Showing posts with label docker-compose. Show all posts

Thursday, August 30, 2018

Permanent aliases

Sometimes typing docker-compose up is too long to type. The best to make it shorter is to create aliases like alias ll="ls -al" but this is only temporary.

To make it a permanent aliases edit the ~/.bashrc and add the following
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias dbup='docker-compose up -d db'
alias up='docker-compose up app'
alias stop='docker-compose stop'
alias re='docker-compose restart'
alias logs='docker-compose logs -f --tail 10'





refresh

source ~/.bashrc

Eureka!

Monday, June 18, 2018

vagrant provisioning thing...

last time I got this error installing docker and docker-compose during the vagrant up.

Ta dang!

config.vm.provision :docker
config.vm.provision :docker_compose


Reference:
https://github.com/leighmcculloch/vagrant-docker-compose

Sunday, February 25, 2018

Setup vagrant but cannot ping other network ip address “Destination Host Unreachable”

I spend many days to figure it out my problem in Vagrant. After I posted my question in stackoverflow, nobody is helping me instead they downvoted my post.

https://stackoverflow.com/questions/48899409/setup-vagrant-but-cannot-ping-other-network-ip-address-destination-host-unreach

Sad! really sad. :( curse you!!!


But anyway, I solved it in my own way. I found this article below
https://github.com/moby/moby/issues/27818

It's simply my docker IP address clashed with my company IP address because when you create the container by default it will create 172.18.xx.xx IP address. Boom! Destination unreachable.... blah blah.

So, I just create a custom docker network and when I checked it created IP address that start 172.19.xx.xx

$ docker network create --driver=bridge --subnet=172.20.0.0/16 --gateway=172.20.0.0 vbroker-network-v1

updated 2018-0720:
docker network create --driver=bridge --subnet=172.28.0.0/16 --gateway=172.28.5.254 vbroker-network

then in the docker-compose.yml, just added
networks:
  default:
    external:
      name: vbroker-network



Eureka!



Thursday, February 8, 2018

the right way to write docker-compose, charing!

version: '2'

services:

  odoo:
    image: odoo:9
    container_name: myevo_odoo
    depends_on:
      - db
    ports:
      - "8069:8069"
    volumes:
      - odoo-web-data:/var/lib/odoo
      - ./myevo_odoo_addons:/mnt/extra-addons
    environment:
      - PYTHONUNBUFFERED=1
      - user=odoo
      - password=odoo
  db:
    image: postgres:9.5.10
    container_name: myevo_db
    ports:
      - "5432:5432"
    environment:
      - POSTGRES_PASSWORD=odoo
      - POSTGRES_USER=odoo
      - PGDATA=/var/lib/postgresql/data/pgdata
    volumes:
      - odoo-db-data:/var/lib/postgresql/data/pgdata
volumes:
  odoo-web-data:
  odoo-db-data:

Sunday, January 14, 2018

Docker issue


1. I had experience once in a blue moon and there's nothing way than to stop/start the docker service. Viola!

Issue:
Error response from daemon: cannot stop container: odoo9: Cannot kill container 0a08b9aefcaa2db053330cbd2b80591a81e68e4027cf6183338fc2700dd940bb: connection error: desc = "transport: dial unix /var/run/docker/containerd/docker-containerd.sock: connect: connection refused": unknown



solution:
sudo /etc/init.d/docker stop
sudo /etc/init.d/docker start





2. When I tried to run latest odoo11 and postgres 10 using docker-compose , I knew I perfectly copied from my configuration in odoo 9 setup but when I hit enter. Bang! issue found.
After a few googling for answers, I think there's some problem with volume. I guess. :)

Issue:

psycopg2.OperationalError: FATAL:  password authentication failed for user "odoo"


Solution:
docker volume rm malphi_malphi_odoo-db-data

Reference:
https://stackoverflow.com/questions/29580798/docker-compose-environment-variables




3. When I installed a new fresh centos environment in vbox. Everything is new, even docker :)
I have this issue everytime I open the virtual box that docker is not running.


Solution:
sudo systemctl start docker
sudo systemctl enable docker

Reference:
https://docs.docker.com/install/linux/linux-postinstall//

Friday, January 12, 2018

Print output does not reflecting in the log

It took me a couple of days just to figure out this problem. I know its a simple as you think but I'm wondering why can't show the print output in the log.

For many test attempt that I have done, I finally figure it out.

Simple.

environment:
      - PYTHONUNBUFFERED=1

that's it, just add this to docker-compose yml file.
Eureka!

Tuesday, December 19, 2017

Docker Networking

Lately I have a problem and yet to be solve. It's related in docker networking I guess.

When I try to run Odoo connect to Postgres using the docker-compose it will run successfully but the problem here is that I couldn't longer connected to my network ip address. If I connect our Odoo UAT as 172.18.6.180:8069 it failed as in FAILED!

After reading a LOT of article about the issue still I can't figure it out. But, I learn a few things about the docker network. Some of it , like below list.

1. Talk about bridge network - https://github.com/docker/labs/blob/master/networking/A2-bridge-networking.md


Running Tomcat and PostgresSQL in Docker



https://blog.lukaspradel.com/dockerizing-a-tomcat-postgresql-java-web-application/

https://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/

free online comma separating tool

https://delim.co/#