-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Hello,
I'm trying to create a new one container of PostgreSQL 18.0 with empty data directory.
Here is my docker-compose yml file:
version: "3"
services:
db:
container_name: "osts_db"
image: postgres:latest
expose:
- "5432"
env_file:
- ../.env
volumes:
- ../postgres_data:/var/lib/postgresql/data
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
reservations:
cpus: '0.25'
memory: 256M
command:
postgres -c max_connections=1000
-c shared_buffers=256MB
-c effective_cache_size=768MB
-c maintenance_work_mem=64MB
-c checkpoint_completion_target=0.7
-c wal_buffers=16MB
-c default_statistics_target=100
restart: unless-stopped
tty: true
stdin_open: true
volumes:
postgres_data: {}
Here is the problem:
Creating osts_db ... error
ERROR: for osts_db Cannot start service db: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/home/.../postgres_data" to rootfs at "/var/lib/postgresql/data": change mount propagation through procfd: open o_path procfd: open /var/lib/docker/overlay2/.../merged/var/lib/postgresql/data: no such file or directory: unknown
ERROR: for db Cannot start service db: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/home/.../postgres_data" to rootfs at "/var/lib/postgresql/data": change mount propagation through procfd: open o_path procfd: open /var/lib/docker/overlay2/.../merged/var/lib/postgresql/data: no such file or directory: unknown
I have checked the path and really there is no directory "merged" in /var/lib/docker/overlay2/<some_hash>.
The same config works good for PostgreSQL 17.6.
Please, help to fix it.
Thank you in advance.
Andrei Shestakov