Skip to content

Commit 9cfcd2d

Browse files
committed
chore: add Barman base image
Now we build an image every week with the base packages required for the sidecar, the idea is to reduce the amount of time of every CI process requires to run. Signed-off-by: Jonathan Gonzalez V. <[email protected]>
1 parent b854830 commit 9cfcd2d

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Barman Base Image
2+
on:
3+
pull_request:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 0 * * 0"
7+
8+
env:
9+
IMAGE_NAME: "gchr.io/cloudnative-pg/plugin-barman-cloud-base"
10+
11+
permissions:
12+
contents: read
13+
packages: write
14+
security-events: write
15+
jobs:
16+
build:
17+
runs-on: ubuntu-24.04
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Log in to the GitHub Container registry
25+
uses: docker/login-action@v3
26+
with:
27+
registry: ghcr.io
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Build Docker Image
32+
uses: docker/build-push-action@v2
33+
with:
34+
context: .
35+
file: ./containers/Dockerfile.barmanbase
36+
push: true
37+
tags: ${{ env.IMAGE_NAME }}:latest
38+
39+
- name: Run Snyk to check Docker image for vulnerabilities
40+
uses: snyk/actions/docker@master
41+
continue-on-error: true
42+
env:
43+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
44+
with:
45+
image: "${{ env.IMAGE_NAME }}:latest"
46+
args: --severity-threshold=high --file=./containers/Dockerfile.barmanbase
47+
-
48+
name: Upload result to GitHub Code Scanning
49+
uses: github/codeql-action/upload-sarif@v3
50+
with:
51+
sarif_file: snyk.sarif

containers/Dockerfile.barmanbase

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM python:3.12-slim AS pythonbuilder
2+
RUN apt-get update && \
3+
apt-get install -y postgresql-common build-essential && \
4+
/usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y && \
5+
apt-get install -y libpq-dev && \
6+
pip install barman[azure,cloud,google,snappy]==3.11.1 setuptools

containers/Dockerfile.sidecar

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache
3434
# pip will build everything inside /usr/ since this is the case
3535
# we should build and then copy every file into a destination that will
3636
# then copy into the distroless container
37-
FROM python:3.13-slim AS pythonbuilder
37+
FROM gchr.io/cloudnative-pg/plugin-barman-cloud-base:latest AS pythonbuilder
3838
RUN apt-get update && \
3939
apt-get install -y postgresql-common build-essential && \
4040
/usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y && \

0 commit comments

Comments
 (0)