Skip to content

Commit

Permalink
Update postgres client in devcontainer
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Dittrich <[email protected]>
  • Loading branch information
jan-di committed Jun 1, 2024
1 parent eed1dba commit 199fdec
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@
ARG VARIANT=""
FROM mcr.microsoft.com/vscode/devcontainers/python:1-${VARIANT}

# Add postgresql repository
RUN set -eu; \
mkdir -p /etc/apt/keyrings; \
wget --quiet -O /etc/apt/keyrings/pgdg.asc https://www.postgresql.org/media/keys/ACCC4CF8.asc; \
sh -c 'echo "deb [signed-by=/etc/apt/keyrings/pgdg.asc] https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends mariadb-client postgresql-client
&& apt-get -y install --no-install-recommends mariadb-client postgresql-client-16
RUN pip install pip-tools

LABEL jan-di.database-backup.instance_id="devcontainer"
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ Docker Image Tags:
- `ghcr.io/jan-di/database-backup` [GitHub Container Registry](https://github.com/jan-di/docker-database-backup/pkgs/container/database-backup)

Supported Architectures: `amd64`, `arm64`
Supported Databases:

- Postgres (<= 16)
- MariaDB
- MySQL

## Service Configuration

Expand Down
31 changes: 31 additions & 0 deletions tests/postgres.docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
x-postgres: &x-postgres
environment:
POSTGRES_PASSWORD: secret
labels:
- jan-di.database-backup.enable=true
- jan-di.database-backup.type=postgres
- jan-di.database-backup.username=postgres
- jan-di.database-backup.password=secret

services:
# All currently supported versions. See https://endoflife.date/postgresql

docker-database-backup-postgres-16-3:
<<: *x-postgres
image: docker.io/postgres:16.3

docker-database-backup-postgres-15-7:
<<: *x-postgres
image: docker.io/postgres:15.7

docker-database-backup-postgres-14-12:
<<: *x-postgres
image: docker.io/postgres:14.12

docker-database-backup-postgres-13-15:
<<: *x-postgres
image: docker.io/postgres:13.15

docker-database-backup-postgres-12-19:
<<: *x-postgres
image: docker.io/postgres:12.19

0 comments on commit 199fdec

Please sign in to comment.