Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker documentation wrong/missing #36

Open
xenoterracide opened this issue Oct 1, 2020 · 3 comments
Open

docker documentation wrong/missing #36

xenoterracide opened this issue Oct 1, 2020 · 3 comments
Assignees

Comments

@xenoterracide
Copy link

xenoterracide commented Oct 1, 2020

first, it'd be nice if the docs mentioned the docker distribution, it's not at the top of the dockerhub list (I'll remove mine), the dockerhub documentation is wrong, the link leads to a 404

docker pull itheory/pg_prove
curl -L https://git.io/fpgAk -o pg_prove && chmod +x pg_prove
./pg_prove --help

also the docker documentation should probably mention the environment variables... I wonder if it would be better to have a sample docker-compose file documented instead of this pg_prove script, since you can run docker-compose up and if it's a container that just exits it will exit when it's done.

maybe something like this

version: '3.7'
services:
  pg_prove:
    image: itheory/pg_prove
    command: --ext .sql --recurse
    volumes:
      - ./:/repo
      - ${PGSERVICEFILE:-./pg_service.conf}:/root/.pg_service.conf
      - ${PGPASSFILE:-./pgpass}:/root/.pgpass
    environment:
      PGSERVICE: ${PGSERVICE:-localhost}
    network_mode: host

one last thing, why is the script mounting $HOME? this seems... strange, and maybe a bad idea in certain CI environments

@theory
Copy link
Owner

theory commented Oct 4, 2020

Fixed the broken git.io link in d6f18fc; totally forgot about it when I renamed master to main.

@theory
Copy link
Owner

theory commented Oct 4, 2020

It mounts home so that it can read your .pgpass and .pgservice files.

@theory theory self-assigned this Oct 4, 2020
@theory
Copy link
Owner

theory commented Oct 24, 2020

@xenoterracide I think there could be a use for a docker compose file, but I don't understand the one you have here. The script mounts home so that it can read all of your Postgres config files as if you were running it on your machine, rather than in a container. It's a way to make execution feel as close to native as possible.

That said, I'm not familiar with docker-compose; maybe it'd be a much better fit! Does it let one map files on the host machine into the container on run? Also, it would have to support a _lot_more environment variables; see the complete list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants