Skip to main content
This example runs PostgreSQL 17 in a microVM, stores the database on a disk-backed named volume, and publishes the service only to host loopback.
The current postgres:17-alpine image contains tab characters in DOCKER_PG_LLVM_DEPS. Passing -e DOCKER_PG_LLVM_DEPS= is a temporary compatibility workaround for microsandbox’s guest environment validation.

Run PostgreSQL

1

Start PostgreSQL

Set a demo password in the host shell:
Start the database:
With no command after the image, microsandbox runs the image’s declared docker-entrypoint.sh postgres command in the background.
2

Wait for readiness

3

Run a query

The tested image returned database examples and PostgreSQL 17.10.Applications on the host can connect to 127.0.0.1:55432 with the same database, user, and password.
Environment variables and command arguments are appropriate for this local demo, not for production secrets. Use secret injection, retain the loopback bind, and configure PostgreSQL access controls before allowing remote clients.
4

Clean up or keep the data

Remove the VM while keeping its database:
Remove the database volume only when you no longer need its contents:
Clear the password from the host shell: