Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PostgreSQL (CloudNativePG)

Build Status Last Commit sysvipc Required

PostgreSQL on FreeBSD, compatible with the CloudNativePG Kubernetes operator. Includes pgvector, pgaudit, and pg_failover_slots.

Warning

Requires ocijail ≥ 0.6.0 (annotation support). This image needs the jail permission allow.sysvipc, applied via OCI annotations. FreeBSD quarterly ships ocijail 0.4.0, which has no annotation support — the container starts but the permission is silently dropped, so the app can crash or misbehave at runtime. Point your pkg repos at the latest branch (ocijail ≥ 0.6.0), then run with the annotation flag below. See the ocijail guide.

Port 5432
Registry ghcr.io/daemonless/cnpg-postgres
Source https://www.postgresql.org/
Website https://cloudnative-pg.io/

Version Tags

Tag Description Best For
17 / 17-standard FreeBSD Quarterly. Uses stable, tested packages. Production stability.
18 / 18-standard / latest / standard FreeBSD Quarterly. Uses stable, tested packages. Most users — recommended.

Prerequisites

Before deploying, ensure your host environment is ready. See the Quick Start Guide for host setup instructions.

Deployment

Podman Compose

services:
  cnpg-postgres:
    image: "ghcr.io/daemonless/cnpg-postgres:latest"
    container_name: cnpg-postgres
    volumes:
      - "/path/to/containers/cnpg-postgres:/var/lib/postgresql/data"
    ports:
      - "5432:5432"
    annotations:
      org.freebsd.jail.allow.sysvipc: "true"
    restart: unless-stopped

AppJail Director

.env:

# .env

DIRECTOR_PROJECT=cnpg-postgres

appjail-director.yml:

# appjail-director.yml

options:
  - virtualnet: ':<random> default'
  - nat:
services:
  cnpg-postgres:
    name: cnpg_postgres
    options:
      - container: 'boot args:--pull'
      - expose: '5432:5432 proto:tcp'
    volumes:
      - cnpg-postgres: /var/lib/postgresql/data
volumes:
  cnpg-postgres:
    device: '/path/to/containers/cnpg-postgres'

Makejail:

# Makejail

ARG tag=latest

OPTION overwrite=force
OPTION from=ghcr.io/daemonless/cnpg-postgres:${tag}
SET allow.sysvipc=1

Note: Exposing ports in AppJail means that your service can be reached from remote hosts. If that is not your intention, do not expose the ports and communicate with the service using the IPv4 address assigned by the virtual network.

Podman CLI

podman run -d --name cnpg-postgres \
  -p 5432:5432 \
  --annotation 'org.freebsd.jail.allow.sysvipc=true' \
  -v /path/to/containers/cnpg-postgres:/var/lib/postgresql/data \
  ghcr.io/daemonless/cnpg-postgres:latest

AppJail

appjail oci run -Pd \
  -o overwrite=force \
  -o container="args:--pull" \
  -o virtualnet=":<random> default" \
  -o nat \
  -o expose="5432:5432 proto:tcp" \
  -o fstab="/path/to/containers/cnpg-postgres /var/lib/postgresql/data <pseudofs>" \
  ghcr.io/daemonless/cnpg-postgres:latest cnpg-postgres

Note: Exposing ports in AppJail means that your service can be reached from remote hosts. If that is not your intention, do not expose the ports and communicate with the service using the IPv4 address assigned by the virtual network.

Ansible

- name: Deploy cnpg-postgres
  containers.podman.podman_container:
    name: cnpg-postgres
    image: "ghcr.io/daemonless/cnpg-postgres:latest"
    state: started
    restart_policy: always
    ports:
      - "5432:5432"
    volumes:
      - "/path/to/containers/cnpg-postgres:/var/lib/postgresql/data"
    annotation:
      org.freebsd.jail.allow.sysvipc: "true"

Parameters

Volumes

Path Description
/var/lib/postgresql/data Database data directory

Ports

Port Protocol Description
5432 TCP PostgreSQL port

Architectures: amd64 User: bsd (UID/GID via PUID/PGID, defaults to 1000:1000) Base: FreeBSD 15.1


Need help? Join our Discord community.

About

PostgreSQL on FreeBSD, compatible with the CloudNativePG Kubernetes operator. Includes pgvector, pgaudit, and pg_failover_slots.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages