Good day to you guys, i have some problem with docker compose / behaviour.
I already set up the directory in host to be bind type on docker volume, so the persistent data would be written on host.
Thing is, regardless of container rm or volume rm and write the compose file with explicit type/source/targets, once the docker is build, it continue to read/writeto volumes instead, ignoring the explicitly bind host directory.
The build cmd was run as root, so the host directory also owned by root:root
Any help or direction would be appreciated. Thanks you for your time reading this, best regards
Ubuntu 24.04 (host name is 20.04 though)
Docker ce version 5:29.8.0-1~ubuntu.24.04~noble
Docker compose yml
services:
metabase:
image: metabase/metabase:v0.62.3.x
container_name: metabase
hostname: metabase
dns:
- ip
- ip
volumes:
- /dev/urandom:/dev/random:ro
ports:
- 3000:3000
environment:
MB_DB_TYPE: postgres
MB_DB_DBNAME: metabasedb
MB_DB_PORT: 5432
MB_DB_USER: /run/secrets/db_user
MB_DB_PASS: /run/secrets/db_password
MB_DB_HOST: postgres
MB_ENCRYPTION_SECRET_KEY: /run/secrets/mb_key
networks:
- metanet1
depends_on:
- postgres
secrets:
- db_password
- db_user
- mb_key
restart: always
postgres:
image: postgres:18
container_name: postgres
hostname: postgres
dns:
- ip
- ip
environment:
POSTGRES_DB: metabasedb
POSTGRES_USER: /run/secrets/db_user
POSTGRES_PASSWORD: /run/secrets/db_password
volumes:
- ./pg_data:/var/lib/postgresql/docker
networks:
- metanet1
secrets:
- db_password
- db_user
restart: always
networks:
metanet1:
driver: bridge
secrets:
db_password:
file: db_password.txt
db_user:
file: db_user.txt
mb_key:
file: mb_key.txt
volumes
Notes : the first volume is leftover after container was rm ed.
