Skip to content

Commit f1d2584

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 f1d2584

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-24.04
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Log in to the GitHub Container registry
26+
uses: docker/login-action@v3
27+
with:
28+
registry: ghcr.io
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Build Docker Image
33+
uses: docker/build-push-action@v2
34+
with:
35+
platforms: "linux/amd64,linux/arm64"
36+
context: .
37+
file: ./containers/Dockerfile.barmanbase
38+
push: true
39+
tags: ${{ env.IMAGE_NAME }}:latest
40+
41+
- name: Run Snyk to check Docker image for vulnerabilities
42+
uses: snyk/actions/docker@master
43+
continue-on-error: true
44+
env:
45+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
46+
with:
47+
image: "${{ env.IMAGE_NAME }}:latest"
48+
args: --severity-threshold=high --file=./containers/Dockerfile.barmanbase
49+
-
50+
name: Upload result to GitHub Code Scanning
51+
uses: github/codeql-action/upload-sarif@v3
52+
with:
53+
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)