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
### 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