Skip to content

postgres /docker-entrypoint.sh not running scripts in /docker-entrypoint-initdb.d/ #40

Closed
@kevinburke

Description

@kevinburke

I'm having trouble writing a script to /docker-entrypoint-initdb.d/ and having Docker run it from /docker-entrypoint.sh.

  • It looks like /docker-entrypoint.sh is supposed to source any scripts it finds in /docker-entrypoint-initdb.d/. I verified I'm running this version of the script by cating the script and verifying this is the expected behavior.
  • I followed the instructions in "justfalter"'s comment here: https://registry.hub.docker.com/_/postgres/ to add a fix-acl.sh file and put it in the correct folder. I double checked the folder name was correct.
  • I also mirrored the commands in the /docker-entrypoint.sh script to check that the script could be sourced and would produce the desired behavior.
  • When I do "docker run", it's clear that Postgres starts but the specified line was not added to pg_hba.conf. I double checked this by verifying the mtime of pg_hba.conf - it wasn't touched or overwritten after my script ran. I also tried having my script touch various files to just verify that it ran, with no success.

I'm at a loss for how to continue debugging this; I placed a file in the place that it's supposed to go, verified that the script runner that starts postgres should run it, and verified that the script does what I want, and I don't see any output (a changed pg_hba.conf, or even a simple file).

I'm running the newest version of everything; starting Docker inside of a Ubuntu Virtualbox being provisioned from Vagrant. I share one folder from the Docker container to the host VM - the data folder containing pg_hba.conf.

Would appreciate your help!
Kevin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions