pgsql

Minimized PostgreSQL docker container

Pure Nim score 15/100 · last commit 2021-06-27 · 1 stars · tests present · no docs generated

Summary

Latest Version Unknown
License Unknown
CI Status Failing
Stars 1
Forks 0
Open Issues 0
Last Commit 2021-06-27
Downloads 0
Last Indexed 2026-08-09 05:03

Installation

nimble install pgsql
choosenim install pgsql
git clone https://gitlab.com/Hack_Char/pgsql

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
pgsql - - - - - - -

Source

Repository https://gitlab.com/Hack_Char/pgsql
Homepage https://gitlab.com/Hack_Char/pgsql
Registry Source gitlab

README

Build a minimized PostgreSQL Container

These instructions assume the repository is cloned into a 'pgsql' directory.

Run:

docker-compose up -d pgsql-strace

This will launch a basic Ubuntu 20.04 container with PostgreSQL running wrapped by strace. You will need to exercise this container with whatever commands you expect to use later. This ensures the strace process is able to capture all the files needed to run the container.

For example:

psql -h localhost -U postgres -W
\du postgres
\dS+
\q

If you didn't set the password, it defaults to 'postgres'

After this, properly shutdown the database:

docker exec -it pgsql_pgsql-strace_1 /usr/bin/pg_ctlcluster 12 main stop

This should stop the container.

Run the parse script:

./parse.sh

This will commmit the strace container as a build image, get the strace.txt file that shows all the file syscalls, parse this file to generate a list of files needed and generate a script that goes in the 'min' directory called 'strace.sh'

Next start up the 'min'imized PostgresSQL container

docker-compose up -d pgsql

You should now have a minimized PostgreSQL container.

Testing showed the Ubuntu based image was 395MB big, the straced build container 438MB and the minimized container 111MB.