Docker is an application-level deployment tool that permits the developers and users to form, deploy, run and maintain their applications by using containers. These containers enable the developers to integrate various parts of their software developing packages/tools/environments/libraries into one instance. By doing this, developers can run their applications within the other environment without worrying of their dependency variations.
Docker behaves kind of a virtual machine. By using Docker functionalities with Odoo 13, the user doesn’t get to stress about the dependencies, packages then forth. Just consider the Odoo image. Odoo has all the required packages and libraries within this image. Thus, Docker makes things easy for both developers and end-users. Let’s explore the key steps to put in Odoo 13 via Docker.
In this blog, I have explained how you install Odoo Using Docker. It is as simple as making a cup of tea.
The docker engine is only suitable for the 64bit operating system. Install Docker in Ubuntu 18.0.4
Make sure that the machine's CPU supports virtualization technology and virtualization support is enabled in BIOS.
Steps to install Odoo with Docker.
First of all, Update Ubuntu
sudo apt update
Install every required package in the system to run the docker
sudo apt install apt-transport-https ca-certificates curl software-properties-common
Get a key for docker maintenance & Security
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 -- recv-keys 58118E89F3A912897C070ADBF76221572C52609D
After adding the key, add docker repository to apt source list
sudo nano /etc/apt/sources.list.d/docker.list
Update all system packages (apt Index)
sudo apt update
sudo apt install docker-ce
sudo apt-get install linux-image-extra-$(uname -r)
Install Official Docker wget for latest Docker Engine
wget -qO- https://get.docker.com/ | sh
Add user in docker groups
usermod -aG docker <user>
sudo systemctl start docker
sudo docker run hello-world
sudo docker stop <processid>
We have successfully installed Docker in the system, now we install odoo using docker.
Run this command to pull postgres and create user
sudo docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres --name db postgres:10
Run this command to pull odoo, now you can see this service is running on your port 8069
sudo docker run -p 0.0.0.0:8069:8069 --name odoo --link db:db -t odoo
Now the Odoo server is running on 0.0.0.0:8069
Start or Stop Odoo Service
sudo docker start/stop odoo
Commands that are useful:
For starting docker with the container use this command docker start container_name
For restarting docker with the container use this command docker restart container_name
For stopping docker with the container use this command docker stop container_name
To start an Odoo instance. The directory should be the same where the docker-compose.yml file exists docker-compose up -d