0% found this document useful (0 votes)
37 views4 pages

Dockerization Bsi

The document discusses setting up Docker to run an Odoo instance using a PostgreSQL database. It provides commands to install Docker and related packages, build an Odoo image, create a network, run a PostgreSQL container, load a database dump, configure Odoo, and run the Odoo container.

Uploaded by

tahina.ramaroson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views4 pages

Dockerization Bsi

The document discusses setting up Docker to run an Odoo instance using a PostgreSQL database. It provides commands to install Docker and related packages, build an Odoo image, create a network, run a PostgreSQL container, load a database dump, configure Odoo, and run the Odoo container.

Uploaded by

tahina.ramaroson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

$ sudo dpkg -l "docker*"

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-================-==========================-============-
===========================================================
ii docker 1.5-2 all transitional
package
ii docker-ce 5:19.03.12~3-0~ubuntu-eoan amd64 Docker: the open-
source application container engine
ii docker-ce-cli 5:19.03.12~3-0~ubuntu-eoan amd64 Docker CLI: the
open-source application container engine
ii docker-compose 1.21.0-3 all Punctual,
lightweight development environments using Docker
un docker-engine <none> <none> (no description
available)
un docker-engine-cs <none> <none> (no description
available)
un docker.io <none> <none> (no description
available)
$ sudo dpkg -l "containerd*"
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-
======================================
un containerd <none> <none> (no description available)
ii containerd.io 1.2.13-2 amd64 An open and reliable container
runtime

si le statut de chaque package n'est pas ii

sudo apt-get install docker


sudo apt-get install docker-ce
sudo apt-get install docker-ce-cli
sudo apt-get install docker-compose
sudo apt-get install containerd.io

Tester docker
$ sudo docker version
Client: Docker Engine - Community
Version: 19.03.12
API version: 1.40
Go version: go1.13.10
Git commit: 48a66213fe
Built: Mon Jun 22 15:45:47 2020
OS/Arch: linux/amd64
Experimental: false

Server: Docker Engine - Community


Engine:
Version: 19.03.12
API version: 1.40 (minimum version 1.12)
Go version: go1.13.10
Git commit: 48a66213fe
Built: Mon Jun 22 15:44:17 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683

$ sudo docker run hello-world

Hello from Docker!


This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:


1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:


https://docs.docker.com/get-started/

$ sudo docker-compose --help


Define and run multi-container applications with Docker.

Usage:
docker-compose [-f <arg>...] [options] [COMMAND] [ARGS...]
docker-compose -h|--help

Options:
-f, --file FILE Specify an alternate compose file
(default: docker-compose.yml)
-p, --project-name NAME Specify an alternate project name
(default: directory name)
--verbose Show more output
--log-level LEVEL Set log level (DEBUG, INFO, WARNING, ERROR,
CRITICAL)
--no-ansi Do not print ANSI control characters
-v, --version Print version and exit
-H, --host HOST Daemon socket to connect to

--tls Use TLS; implied by --tlsverify


--tlscacert CA_PATH Trust certs signed only by this CA
--tlscert CLIENT_CERT_PATH Path to TLS certificate file
--tlskey TLS_KEY_PATH Path to TLS key file
--tlsverify Use TLS and verify the remote
--skip-hostname-check Don't check the daemon's hostname against the
name specified in the client certificate
--project-directory PATH Specify an alternate working directory
(default: the path of the Compose file)
--compatibility If set, Compose will attempt to convert deploy
keys in v3 files to their non-Swarm equivalent

Commands:
build Build or rebuild services
bundle Generate a Docker bundle from the Compose file
config Validate and view the Compose file
create Create services
down Stop and remove containers, networks, images, and volumes
events Receive real time events from containers
exec Execute a command in a running container
help Get help on a command
images List images
kill Kill containers
logs View output from containers
pause Pause services
port Print the public port for a port binding
ps List containers
pull Pull service images
push Push service images
restart Restart services
rm Remove stopped containers
run Run a one-off command
scale Set number of containers for a service
start Start services
stop Stop services
top Display the running processes
unpause Unpause services
up Create and start containers
version Show the Docker-Compose version information

$ mkdir docker-bsi
$ cd docker-bsi
$ sudo -u postgres pg_dump -d bestinfo > dump.sql
$ git clone https://github.com/odoo/docker.git
$ cd 14.0
$ sudo docker build -t docker-bsi .
$ sudo docker network create network-bsi
$ sudo docker run -d --network network-bsi --network-alias pgbsi -v pgbsi-
data:/var/lib/postgresql/data -e POSTGRES_USER=postgres -e
POSTGRES_PASSWORD=secret -e POSTGRES_DB=postgres -p 5442:5432 postgres:12
$ sudo -u postgres psql -p 5442 -h 127.0.0.1 -c "create user bestinfo with
password 'secret';"
$ sudo -u postgres psql -p 5442 -h 127.0.0.1 -c "create database bestinfo with
owner = bestinfo encoding = 'utf8' connection limit -1;"
$ sudo -u postgres psql -p 5442 -h 127.0.0.1 -d bestinfo -c "create
extension \"unaccent\";"
$ sudo -u bestinfo psql -p 5442 -h 127.0.0.1 -f dump.sql
$ mkdir conf
$ cp odoo.conf conf/odoo.conf
$ vi conf/odoo.conf
[options]
addons_path = /mnt/extra-addons
data_dir = /var/lib/odoo
db_host = pgbsi
db_maxconn = 64
db_name = bestinfo
db_password = secret
db_port = 5432
db_sslmode = prefer
db_template = template1
db_user = bestinfo
dbfilter = bestinfo
email_from = False
http_enable = True
http_port = 8069
import_partial =
list_db = True
log_db = False
log_db_level = warning
log_handler = :INFO
log_level = info
logfile = False
logrotate = False
longpolling_port = 8072
max_cron_threads = 2
transient_age_limit = 1.0
osv_memory_count_limit = False
pg_path = /usr/bin
pidfile = False
proxy_mode = False
reportgz = False
server_wide_modules = web
smtp_password = False
smtp_port = 25
smtp_server = localhost
smtp_ssl = False
smtp_user = False
syslog = False
test_enable = False
test_file = False
test_tags = None
translate_modules = ['all']
unaccent = True
without_demo = False
workers = 2

$ sudo docker run -p 8069:8069 --mount


type=bind,src=/path/to/filestore/bestinfo,target=/var/lib/odoo/filestore/
bestinfo -v /path/to/conf:/etc/odoo --network network-bsi -e
DB_PORT_5432_TCP_ADDR=pgbsi -e POSTGRES_USER=bestinfo -e
POSTGRES_PASSWORD=secret --name container-name -t docker-bsi

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy