0

I would like to configure some postgres.conf parameters (wal_level, archive_mode, archive_timeout) in a Dockerfile that inherits FROM centos/postgresql-94-centos7:9.4

What is the best way of doing this?

Yo Ludke
  • 2,149
  • 2
  • 23
  • 38
  • Possible duplicate of [Editing files from dockerfile](https://stackoverflow.com/questions/27713362/editing-files-from-dockerfile) – Romeo Ninov Jan 18 '19 at 13:07

1 Answers1

0

I ended up using a docker-compose file that mounts the pg data dir on host

    volumes:
      # See end of "Environment variables and volumes" section on
      # https://hub.docker.com/r/centos/postgresql-94-centos7
      - /path/on/host:/var/lib/pgsql/data

and have a script on host that edits the file and runs docker-compose up afterwards. (This depends on your setup, if you're not working on a PoC but on something more permanent, it makes sense to edit the file when creating the docker image)

Yo Ludke
  • 2,149
  • 2
  • 23
  • 38