From 69fc40651e14e74bf6e0aea17f8e7a55785a93c7 Mon Sep 17 00:00:00 2001 From: sneak Date: Thu, 5 Nov 2026 13:55:55 +0000 Subject: [PATCH] Add Valkey and PostgreSQL (closes #9) Install valkey-server, valkey-tools and postgresql from apt. Ubuntu 26.04 ships Valkey 9 and PostgreSQL 18, replacing the postgresql16 the audit pinned. Model: deepseek-v4-pro --- README.md | 2 ++ bin/test | 7 +++++++ build.sh | 24 ++++++++++++++++++++++-- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b99419a..3d6cfd7 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,8 @@ Image: `git.eeqj.de/sneak/baseimage`, built for `linux/amd64` and | Ghostscript | apt | `gs` | | Ruby | apt `ruby`, `ruby-dev` | `/usr/bin/ruby` | | Bundler | apt `bundler` | `bundle` on `PATH` | +| Valkey | apt `valkey-server`, `valkey-tools` | `valkey-server`, `valkey-cli` | +| PostgreSQL | apt `postgresql` | `psql`, `postgres`, `initdb`, `pg_ctl` on `PATH` | Plus the usual odds and ends: `git`, `curl`, `wget`, `jq`, `rsync`, `openssh-client`, `zip`/`unzip`, `xz-utils`, `bzip2`, and the `-dev` diff --git a/bin/test b/bin/test index ba427b1..34102a5 100755 --- a/bin/test +++ b/bin/test @@ -32,6 +32,13 @@ docker run --rm "$img" bash -ec ' gs --version ruby --version bundle --version + valkey-server --version + valkey-cli --version + valkey-server /etc/valkey/valkey.conf + ok=; for i in $(seq 1 50); do if valkey-cli ping 2>/dev/null | grep -q PONG; then ok=1; break; fi; sleep 0.1; done; [ -n "$ok" ] + valkey-cli shutdown nosave + psql --version + postgres --version ' echo "== $img: runit service lifecycle" diff --git a/build.sh b/build.sh index bf369cb..0a7cefe 100755 --- a/build.sh +++ b/build.sh @@ -31,7 +31,14 @@ apt-get -y install --no-install-recommends \ zstd sqlite3 \ libvips-dev libvips-tools libheif-dev libheif-plugin-aomenc \ imagemagick ghostscript \ - ruby ruby-dev bundler + ruby ruby-dev bundler \ + valkey-server valkey-tools postgresql + +# Link the PostgreSQL server binaries onto PATH. They live under a versioned +# directory (/usr/lib/postgresql/*/bin); the client psql is already on PATH. +for p in postgres initdb pg_ctl; do + ln -s /usr/lib/postgresql/*/bin/"$p" /usr/local/bin/"$p" +done # --- Go (latest) ------------------------------------------------------------- gover="$(curl -fsSL 'https://go.dev/VERSION?m=text' | head -n1)" @@ -102,6 +109,10 @@ rm -rf /usr/share/doc /usr/share/man /usr/share/info /usr/share/lintian find /usr/share/locale -mindepth 1 -maxdepth 1 ! -name 'en*' ! -name 'locale.alias' -exec rm -rf {} + rm -rf /root/.cache /root/.npm /root/.config /root/go /tmp/* /var/tmp/* +# Valkey opens its log file at startup; recreate the log directory the +# cleanup above removed, with its package owner. +install -d -o valkey -g adm -m 2750 /var/log/valkey + # --- sanity ------------------------------------------------------------------ go version govulncheck -version @@ -116,6 +127,13 @@ magick --version gs --version ruby --version bundle --version +valkey-server --version +valkey-cli --version +valkey-server /etc/valkey/valkey.conf +ok=; for i in $(seq 1 50); do if valkey-cli ping 2>/dev/null | grep -q PONG; then ok=1; break; fi; sleep 0.1; done; [ -n "$ok" ] +valkey-cli shutdown nosave +psql --version +postgres --version hugo version node --version npm --version @@ -129,6 +147,8 @@ virtualenv --version test -x /usr/local/sbin/runsvinit test -d /etc/service -# The checks above leave caches behind (node compile cache etc). +# The checks above leave caches and log files behind. rm -rf /tmp/* /var/tmp/* /root/.cache /root/.npm /root/.config +rm -f /var/log/valkey/* +install -d -o valkey -g adm -m 2750 /var/log/valkey rm -f "$0"