Compare commits

...
1 Commits
Author SHA1 Message Date
sneak 396ef7e6b9 The base image never starts a service (closes #16)
build.sh and bin/test used to start valkey-server and ping it to prove it runs;
they now check it with valkey-server --version and valkey-cli --version, so the
ping loop, shutdown, and the cleanup of the Valkey run's log files are gone.
/var/log/valkey and /var/log/nginx keep their package owners and modes, and
nginx -t stays. README states that Valkey, PostgreSQL and nginx are installed
but never run. No package install starts a service: invoke-rc.d already denies
every start, and no ENTRYPOINT or CMD starts one.

Model: deepseek-v4-pro
2026-11-05 19:51:53 +00:00
3 changed files with 5 additions and 10 deletions
+3
View File
@@ -140,6 +140,9 @@ exec /usr/local/bin/myapp
Services should log to stdout/stderr; the container's log is the combined
output of all services.
The image installs Valkey, PostgreSQL and nginx but never runs them; a child
image that wants one runs it as a service.
The image sets `CMD ["/usr/local/sbin/runsvinit"]` and no `ENTRYPOINT`, so
a child image that only needs one unsupervised process can override `CMD`
and ignore runit entirely, and `docker run -it image bash` works as
-3
View File
@@ -34,9 +34,6 @@ docker run --rm "$img" bash -ec '
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
nginx -t
+2 -7
View File
@@ -146,8 +146,8 @@ 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/*
# nginx and Valkey open their log files at startup; recreate the log
# directories the cleanup above removed, with their package owners.
# Recreate the log directories the cleanup above removed, with their package
# owners, so child images have them ready without recreating them at startup.
install -d -o root -g adm /var/log/nginx
install -d -o valkey -g adm -m 2750 /var/log/valkey
@@ -167,9 +167,6 @@ 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
nginx -t
@@ -192,7 +189,5 @@ test -d /etc/service
# 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/*
rm -f /var/log/nginx/*
install -d -o valkey -g adm -m 2750 /var/log/valkey
rm -f "$0"