2026-02-15 01:07:25 -05:00
2020-07-28 01:37:10 -04:00
# ERPLibre - Docker
2020-09-30 20:49:35 -04:00
Those images are prepared to permit better portability and reproducibility of ERPLibre release.
2020-07-28 01:37:10 -04:00
2024-08-25 15:54:24 -04:00
Due the growing code of ERPLibre, it could also simplify development.
2020-07-28 01:37:10 -04:00
2020-09-30 20:49:35 -04:00
NOTE: Those Dockerfiles themselves are in heavy development for now. Incompatibilities between releases are normal until the interface is stabilized.
2020-07-28 01:37:10 -04:00
2020-07-28 06:09:58 -04:00
## Pre-requirements
2020-07-28 01:37:10 -04:00
2020-07-28 06:09:58 -04:00
- Basic knowledge with Docker, Linux and bash
2020-07-28 01:37:10 -04:00
- Latest Docker version
## Files representations
2020-09-30 20:49:35 -04:00
- Dockerfile.base: This Dockerfile represents the base Docker image layer reused by other child layers.
2020-07-28 06:09:58 -04:00
- Dockerfile.dev: This Dockerfile is specialized in development.
2020-09-30 20:49:35 -04:00
- Dockerfile.prod{pkg,src}: Dockerfile.prod.\* is a Docker image specialized for production systems. Dockerfile.prod.pkg reuses official Debian files from Odoo.com. Dockerfile.prod.src fetches the Odoo source code as the ERPLibre runtime.
2020-07-28 01:37:10 -04:00
## Getting started
2020-07-28 06:09:58 -04:00
Be sure to start daemon docker
2026-02-15 01:07:25 -05:00
2020-07-28 06:09:58 -04:00
```bash
systemctl start docker
```
2020-07-28 01:37:10 -04:00
2020-07-28 06:09:58 -04:00
### Building the docker images
2020-07-28 01:37:10 -04:00
2020-07-28 06:09:58 -04:00
```bash
cd docker
docker build -f Dockerfile.base -t technolibre/erplibre-base:12.0 .
docker build -f Dockerfile.prod.pkg -t technolibre/erplibre:12.0-pkg .
```
2020-07-28 01:37:10 -04:00
[UPD] install : le venv d'outillage passe en Python 3.14.7
install_erplibre.sh bâtissait .venv.erplibre avec le python3 du système, quelle
que soit sa version : un 3.10 y donnait un venv que l'outillage ne sait pas
charger. Il délègue à install_venv.sh, qui obtient la version par mise, pyenv
ou la distribution, et rebâtit un venv hors service. Le PATCH ne borne que le
venv d'Odoo, dont le pyproject exige « >=3.12.10,<3.13 » : l'exiger ailleurs
écartait un Python de distribution d'un cran en retard — NixOS 25.11 livre
3.14.2 — et faisait compiler CPython pour rien. Le module NixOS déclare
désormais les DEUX Python, substitués depuis les fichiers de version.
Vérifié : 15 tests sur des venvs factices, conservés, rebâtis ou refusés selon
leur état, et un chemin sans pyvenv.cfg garde son contenu.
--- EN ---
install_erplibre.sh built .venv.erplibre with the system python3, whatever its
version: a 3.10 gave a venv the tooling cannot load. It delegates to
install_venv.sh, which obtains the version through mise, pyenv or the
distribution, and rebuilds a venv out of service. The PATCH bounds only Odoo's
venv, whose pyproject requires ">=3.12.10,<3.13": requiring it elsewhere turned
away a distribution Python one step behind — NixOS 25.11 ships 3.14.2 — and
compiled CPython for nothing. The NixOS module now declares BOTH Pythons,
substituted from the version files.
Checked: 15 tests on stub venvs, kept, rebuilt or refused by their state, and a
path without pyvenv.cfg keeps its content.
Assisted-by: Claude Opus 5
2026-09-24 13:31:32 -04:00
`.venv.erplibre` is built on the image's own Python, Odoo's, without mise or
pyenv. The build stops when that Python cannot parse `script/` , which happens
with a deprecated Odoo version.
2020-07-28 01:37:10 -04:00
### Running ERPLibre using Docker-Compose
2020-07-28 06:09:58 -04:00
Go at the root of this git project.
2026-02-15 01:07:25 -05:00
2020-07-28 06:09:58 -04:00
```bash
cd ERPLibre
2024-04-22 23:45:53 -04:00
docker compose -f docker-compose.yml up -d
2020-07-28 06:09:58 -04:00
```
### Diagnostic Docker-Compose
Show docker-compose information
2026-02-15 01:07:25 -05:00
2020-07-28 06:09:58 -04:00
```bash
2024-04-22 23:45:53 -04:00
docker compose ps
docker compose logs IMAGE_NAME
2020-07-28 06:09:58 -04:00
```
Show docker information
2026-02-15 01:07:25 -05:00
2020-07-28 06:09:58 -04:00
```bash
docker ps -a
docker volume ls
docker inspect DOCKER_NAME
```
Connect to a running docker
2026-02-15 01:07:25 -05:00
2020-07-28 06:09:58 -04:00
```bash
docker exec -ti DOCKER_NAME bash
docker exec -u root -ti DOCKER_NAME bash
```
2020-09-30 20:49:35 -04:00
Commands for debugging
2026-02-15 01:07:25 -05:00
2020-07-28 06:09:58 -04:00
```bash
docker run -p 8069:8069 --entrypoint bash -ti DOCKER_NAME
docker exec -ti DOCKER_NAME bash
docker exec -u root -ti DOCKER_NAME bash
docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -e POSTGRES_USER=odoo -e POSTGRES_DB=postgres postgre
export
db_host = "host.docker.internal"
2020-08-02 00:10:34 -04:00
docker stats erplibre_ERPLibre_1
2020-07-28 06:09:58 -04:00
```
### Cleaning
2020-10-11 10:39:47 -04:00
Delete all system
2026-02-15 01:07:25 -05:00
2020-10-11 10:39:47 -04:00
```bash
docker system prune -a
```
2020-07-28 06:09:58 -04:00
Delete docker image
2026-02-15 01:07:25 -05:00
2020-07-28 06:09:58 -04:00
```bash
docker image prune
2020-10-11 10:39:47 -04:00
docker rmi $(docker images -q)
2020-07-28 06:09:58 -04:00
```
Delete volumes
2026-02-15 01:07:25 -05:00
2020-07-28 06:09:58 -04:00
```bash
2024-04-22 23:45:53 -04:00
docker compose rm -v
2020-07-28 06:09:58 -04:00
```
Delete containers
2026-02-15 01:07:25 -05:00
2020-07-28 06:09:58 -04:00
```bash
docker rm $(docker ps -a | grep -v IMAGE | awk '{print $1}')
```
Delete volume
2026-02-15 01:07:25 -05:00
2020-07-28 06:09:58 -04:00
```bash
docker volume prune
```
2020-07-29 18:12:06 -04:00
2020-09-30 20:49:35 -04:00
# Change docker directory
You can change the docker directory by editing file `/etc/docker/daemon.json`
2026-02-15 01:07:25 -05:00
2020-07-29 18:12:06 -04:00
```json
{
"data-root": "/home/docker"
}
```
2026-02-15 01:07:25 -05:00
2020-09-30 20:49:35 -04:00
And restart docker service. You can delete or move all older locations of docker.
2020-08-10 15:52:51 -04:00
2025-03-21 04:19:17 -04:00
Or
Add `--data-root /second_drive/docker` like example following into file `/lib/systemd/system/docker.service` :
2026-02-15 01:07:25 -05:00
2025-03-21 04:19:17 -04:00
```
ExecStart=/usr/bin/dockerd --data-root /second_drive/docker -H fd:// --containerd=/run/containerd/containerd.sock
```
2020-08-10 15:52:51 -04:00
# Update docker
When building your docker with script
2026-02-16 10:30:53 -05:00
> make docker_build_odoo_18
2020-08-10 15:52:51 -04:00
2020-10-03 01:36:29 -04:00
List your docker version
2021-06-30 22:26:20 -04:00
> docker images
2020-10-03 01:36:29 -04:00
2020-08-10 15:52:51 -04:00
You need to push your docker image and update your tag, like 1.0.1:
2020-10-03 01:36:29 -04:00
> docker push technolibre/erplibre:VERSION
2022-01-24 23:07:15 -05:00
# Diagnostic
When getting and error about missing module, or after an upgrade, you need to update config file.
> make docker_exec_erplibre_gen_config