Commit Graph

34 Commits

Author SHA1 Message Date
Marco Nenciarini
b89152646e
docs: clean up Dockerfile comments for clarity and accuracy
Remove obvious comments that restate what code does, fix misleading
cross-compilation explanation, and improve grammar.

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
2026-01-29 15:50:50 +01:00
Marco Nenciarini
2f1ca8ab19
fix: use sysconfig for Python stdlib path and remove x86_64 comment
Use sysconfig.get_path('stdlib') to dynamically determine the Python
standard library path instead of hardcoding python3.13. Also remove
architecture-specific comment since this is a multiarch image.

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
2026-01-29 15:41:03 +01:00
Marco Nenciarini
4cab8f826b
fix: compile all Python bytecode in final stage as root
Move compileall to the final distroless stage and run it as root
to ensure all Python files are pre-compiled, including the system
standard library. This avoids runtime compilation errors when the
filesystem is read-only.

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
2026-01-29 14:32:00 +01:00
Marco Nenciarini
c8220fb3a9
fix: automate library dependency detection using distroless package list
Replace the manual library exclusion list with automated dependency
resolution using apt-cache. The approach queries the dependency tree
of packages in the distroless base image (from GoogleContainerTools
distroless configs) and excludes them from our requirements.

This reduces the image to 260MB (down from 270MB) by avoiding
duplicate libraries already present in the distroless base. Only 7
packages are now downloaded instead of manually maintaining a list
of 13 exclusions.

The package list is sourced from distroless upstream configs and
documented with URLs, making it maintainable as distroless evolves.

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
2026-01-29 13:39:48 +01:00
Marco Nenciarini
a29726e0ee
fix: use distroless base image to reduce size and attack surface
Switch from python:3.13-slim-trixie to distroless/python3-debian13
for the sidecar container. The virtualenv approach now extracts
runtime libraries from Debian packages using dpkg, eliminating the
need for apt and package management tools in the final image.

The image is 44% smaller (260MB vs 463MB on main, or 31% vs 377MB
from the previous commit) with 70% fewer packages (35 vs 115) while
maintaining zero HIGH/CRITICAL vulnerabilities. There is no shell
or package manager in the final image, reducing the attack surface
significantly.

Based on Google's distroless best practices.

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
2026-01-29 13:39:48 +01:00
Marco Nenciarini
a9d8dbba6e
fix: add compression library dependencies for barman
Barman-cloud requires lz4 and snappy compression libraries for
backup and WAL compression. The pythonbuilder stage needs the
development headers (liblz4-dev, libsnappy-dev) to compile the
Python C-extensions into wheels, and the final runtime image
needs the shared libraries (liblz4-1, libsnappy1v5) for the
extensions to function.

Without these dependencies, backups fail when attempting to
compress data, causing the backup to enter a failed state.

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
2026-01-29 09:27:10 +01:00
Marco Nenciarini
883ba6aa24
fix: use wheel-based build to fix bytecode staleness
The sidecar uses a read-only filesystem which prevents Python from
creating bytecode at runtime. The previous approach pre-compiled
bytecode in a separate base image, but timestamps were corrupted
when files were copied between Docker stages, causing Python to
mark the bytecode as stale and recompile on every invocation.

This change builds Python dependencies as wheels in a pythonbuilder
stage using BuildKit cache mounts, then installs them in the final
python:3.13-slim-trixie stage using a bind mount. Wheels include
pre-compiled bytecode with correct timestamps. The bind mount keeps
wheels out of final layers, and the distroless complexity is
eliminated.

After wheel installation, we run compileall to ensure all Python
bytecode is freshly compiled with correct timestamps, preventing
any stale bytecode from remaining in the final image.

The separate barmanbase image, its workflow, and related Renovate
configuration are no longer needed and have been removed.

Closes #711
Closes #735

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
2026-01-28 19:45:38 +01:00
renovate[bot]
064eac2199
chore(deps): update golang docker tag to v1.25.6 (#734)
Some checks failed
release-please / release-please (push) Failing after 39s
Barman Base Image / build (push) Failing after 4s
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-18 22:33:55 +01:00
renovate[bot]
fa546eae05
feat(deps): update barman-cloud to v3.17.0 (#702)
Some checks failed
release-please / release-please (push) Failing after 3s
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
2026-01-14 13:39:57 +01:00
renovate[bot]
1ce6a787af
chore(deps): update barman-cloud-base docker tag to v3.16.2-202512221525 (#650)
Some checks failed
release-please / release-please (push) Failing after 4s
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-22 20:42:42 +01:00
renovate[bot]
1e504cbade
chore(deps): update golang docker tag to v1.25.5 (#674)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-22 14:07:33 +01:00
renovate[bot]
116cd910ba
chore(deps): update golang docker tag to v1.25.4 (#643)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-05 23:40:28 +01:00
renovate[bot]
1ef53d0341
feat(deps): update barman-cloud to v3.16.2 (#609)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-05 20:05:46 +01:00
renovate[bot]
67ecc6228e
chore(deps): update plugin-barman-cloud-base docker tag to v3.16.1-202510150740 (#579)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-15 14:20:58 +02:00
renovate[bot]
d0b18bb5b9
chore(deps): update golang docker tag to v1.25.3 (#591)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| golang |  | patch | `1.25.2` -> `1.25.3` |
| golang | stage | patch | `1.25.2` -> `1.25.3` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/cloudnative-pg/plugin-barman-cloud).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNDMuMSIsInVwZGF0ZWRJblZlciI6IjQxLjE0My4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0ZWQiLCJuby1pc3N1ZSJdfQ==-->

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-15 09:54:25 +02:00
renovate[bot]
a7e1b706b9
chore(deps): update golang docker tag to v1.25.2 (#573)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-08 12:37:42 +02:00
renovate[bot]
8714d9f14f
chore(deps): update golang docker tag to v1.25.1 (#518)
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| docker     | golang  | 1.25.0 | 1.25.1 |

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-18 10:45:17 +02:00
Niccolò Fei
70e12dea9a
chore: use plugin-barman-cloud-base image to build the sidecar (#479)
Signed-off-by: Jonathan Gonzalez V. <jonathan.gonzalez@enterprisedb.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Co-authored-by: Jonathan Gonzalez V. <jonathan.gonzalez@enterprisedb.com>
2025-08-21 11:38:30 +02:00
renovate[bot]
0ef6423466
chore(deps): update golang docker tag to v1.25.0 (#482)
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| docker     | golang  | 1.24.6 | 1.25.0 |

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-21 08:45:31 +02:00
Leonardo Cecchi
b2645827b8
fix(images): use bookworm for sidecar image (#476)
We were using debian trixie as a building environment for barman-cloud,
but we were still using bookworm as a base image. This caused
inconsistencies in the sidecar image.

Now we always use bookworm.

Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
2025-08-14 22:21:52 +02:00
renovate[bot]
9a6afdfb23
chore(deps): update golang docker tag to v1.24.6 (#442)
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| docker     | golang  | 1.24.4 | 1.24.6 |

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-09 20:03:51 +02:00
renovate[bot]
c8f6ccfa57
chore(deps): update golang docker tag to v1.24.4 (#397)
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| docker     | golang  | 1.24.3 | 1.24.4 |

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-10 10:27:31 +02:00
renovate[bot]
45055d049d
chore(deps): update golang docker tag to v1.24.3 (#321)
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| docker     | golang  | 1.24.2 | 1.24.3 |

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-07 10:19:15 +02:00
renovate[bot]
d43272ecf2
chore(deps): update golang docker tag to v1.24.2 (#252)
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| docker     | golang  | 1.24.1 | 1.24.2 |

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-08 15:50:26 +02:00
renovate[bot]
7c218a2235
chore(deps): update golang docker tag to v1.24.1 (#186)
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| docker     | golang  | 1.24.0 | 1.24.1 |

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-05 11:45:55 +01:00
renovate[bot]
f745c6091c
chore(deps): update golang docker tag to v1.24.0 (#176)
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| docker     | golang  | 1.23.5 | 1.24.0 |

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-27 11:08:36 +01:00
Francesco Canovai
51e4dc00ab
chore: update sidecar Dockerfile to use renovate (#135)
Rework the Dockerfile to list Python dependencies.
Those can be updated using renovate.

Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Co-authored-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
2025-02-04 17:47:02 +01:00
renovate[bot]
1b48b74996
chore(deps): update golang docker tag to v1.23.5 (#145)
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| docker     | golang  | 1.23.4 | 1.23.5 |

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-28 13:34:57 +01:00
Francesco Canovai
56a163b46c
ci: improve caching (#84)
Improve cache usage for faster local ci runs.

Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
2024-12-09 11:40:11 +01:00
renovate[bot]
e47b26b11e
chore(deps): update golang docker tag to v1.23.4 (#80)
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| docker     | golang  | 1.23.3 | 1.23.4 |

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-06 13:32:14 +01:00
renovate[bot]
906fd233ee
chore(deps): update golang docker tag to v1.23.3 (#39)
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| docker     | golang  | 1.23.2 | 1.23.3 |
| docker     | golang  | 1.23.1 | 1.23.3 |

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-20 09:15:27 +01:00
renovate[bot]
07215c7c75
chore(deps): update python docker tag to v3.13 (#40)
| datasource | package | from | to   |
| ---------- | ------- | ---- | ---- |
| docker     | python  | 3.12 | 3.13 |

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-19 09:00:56 +00:00
Armando Ruocco
240077c771
feat(spike): restore (#29)
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Co-authored-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
2024-11-06 16:01:56 +01:00
Francesco Canovai
f877bb19d7
ci: build amd64 and arm64 images for the sidecar and the plugin (#26)
Adds support for building and publishing Docker images for both amd64 and arm64 architectures.
Ensures compatibility across multiple platforms by using cross-compilation.
Updates relevant configuration files for CI/CD to handle the new build process.
Fixes issues related to Python version conflicts and ensures the correct directory structure in the final image.

Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Jonathan Gonzalez V. <jonathan.abdiel@gmail.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Co-authored-by: Jonathan Gonzalez V. <jonathan.abdiel@gmail.com>
Co-authored-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
2024-10-24 10:27:26 +02:00