Ran and persisted a stateful Postgres service entirely through Docker Desktop: pulled postgres:16, created a named volume, launched a container with a published port and mounted volume, seeded a table over the Exec tab, proved the data survived a restart, then reached it from a second Adminer container over the network.
Do everything through the Docker Desktop app: the Images, Volumes, and Containers tabs and each container's Logs, Files, and Exec tabs. The only step outside Docker Desktop is opening a browser for Adminer. No docker commands typed in your own shell.
postgres:16, the specific tag, not latest.shopdata.postgres:16 and open Optional settings. Set: /var/lib/postgresql/data Then run it. It should appear running in the Containers tab.shop-db5432 (mapped to the container's 5432)POSTGRES_PASSWORD = devpassshopdata volume at container pathdatabase system is ready to accept connections.psql -U postgres. Type these in by hand (don't paste), confirming each: `sql CREATE TABLE products (id serial primary key, name text, price int); INSERT INTO products (name, price) VALUES ('Mug', 1299), ('Bottle', 1899); SELECT * FROM products; `/var/lib/postgresql/data; the database files stored there are what the shopdata volume is holding onto.SELECT * FROM products;. The two rows should still be there. That's the named volume doing its job: the data outlived the container restart.adminer, then Run it with Host port 8080. Open http://localhost:8080 in a browser and log in with System: PostgreSQL, Server: host.docker.internal, Username: postgres, Password: devpass. Open the products table; you should see your two rows, now served to a separate container over the network.Deliverable · captured from the machine
{
"shop-db": {
"image": "postgres:16",
"port": [
"5432/tcp"
],
"env_has_password": true,
"mount_type": "volume",
"volume_name": "shopdata",
"mount_dest": "/var/lib/postgresql/data"
},
"adminer": {
"container_name": "db-view",
"image": "adminer:latest",
"port": [
"8080/tcp"
]
}
}[
{
"Id": "a94897665f67e9a5ba59e2bc60503e73cd704a6747fe13d1cb18168a18ccf138",
"Created": "2026-08-12T23:55:53.794246418Z",
"Path": "entrypoint.sh",
"Args": [
"docker-php-entrypoint",
"php",
"-S",
"[::]:8080",
"-t",
"/var/www/html"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 1288,
"ExitCode": 0,
"Error": "",
"StartedAt": "2026-08-12T23:55:54.188122668Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:890cffec7caa20159fb6f68c1a521b2e5879f7314f4845d4ebca7cc1cf145971",
"ResolvConfPath": "/var/lib/docker/containers/a94897665f67e9a5ba59e2bc60503e73cd704a6747fe13d1cb18168a18ccf138/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/a94897665f67e9a5ba59e2bc60503e73cd704a6747fe13d1cb18168a18ccf138/hostname",
"HostsPath": "/var/lib/docker/containers/a94897665f67e9a5ba59e2bc60503e73cd704a6747fe13d1cb18168a18ccf138/hosts",
"LogPath": "/var/lib/docker/containers/a94897665f67e9a5ba59e2bc60503e73cd704a6747fe13d1cb18168a18ccf138/a94897665f67e9a5ba59e2bc60503e73cd704a6747fe13d1cb18168a18ccf138-json.log",
"Name": "/db-view",
"RestartCount": 0,
"Driver": "overlayfs",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": [],
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "bridge",
"PortBindings": {
"8080/tcp": [
{
"HostIp": "",
"HostPort": "8080"
}
]
},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"ConsoleSize": [
0,
0
],
"CapAdd": null,
"CapDrop": null,
"CgroupnsMode": "private",
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "private",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,[
{
"Id": "feb3afdb78fb791f41dfbfd3125085c4738373187ac8917612947324387c96d5",
"Created": "2026-08-12T23:53:30.058676588Z",
"Path": "docker-entrypoint.sh",
"Args": [
"postgres"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 1119,
"ExitCode": 0,
"Error": "",
"StartedAt": "2026-08-12T23:55:06.224771591Z",
"FinishedAt": "2026-08-12T23:55:03.961444215Z"
},
"Image": "sha256:95206741a5b214807675e14165369d05b93a9cf692223b616d07cca227e74b0b",
"ResolvConfPath": "/var/lib/docker/containers/feb3afdb78fb791f41dfbfd3125085c4738373187ac8917612947324387c96d5/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/feb3afdb78fb791f41dfbfd3125085c4738373187ac8917612947324387c96d5/hostname",
"HostsPath": "/var/lib/docker/containers/feb3afdb78fb791f41dfbfd3125085c4738373187ac8917612947324387c96d5/hosts",
"LogPath": "/var/lib/docker/containers/feb3afdb78fb791f41dfbfd3125085c4738373187ac8917612947324387c96d5/feb3afdb78fb791f41dfbfd3125085c4738373187ac8917612947324387c96d5-json.log",
"Name": "/shop-db",
"RestartCount": 0,
"Driver": "overlayfs",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": [
"09242dea517601520892ce1ec4474c810007bac148e46cf8545a24b24c51e71f"
],
"HostConfig": {
"Binds": [
"shopdata:/var/lib/postgresql/data"
],
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "bridge",
"PortBindings": {
"5432/tcp": [
{
"HostIp": "",
"HostPort": "5432"
}
]
},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"ConsoleSize": [
0,
0
],
"CapAdd": null,
"CapDrop": null,
"CgroupnsMode": "private",
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "private",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,[
{
"CreatedAt": "2026-08-12T23:52:52Z",
"Driver": "local",
"Labels": null,
"Mountpoint": "/var/lib/docker/volumes/shopdata/_data",
"Name": "shopdata",
"Options": null,
"Scope": "local"
}
]id | name | price ----+--------+------- 1 | Mug | 1299 2 | Bottle | 1899 (2 rows)