droher / boxball

Prebuilt Docker images with Retrosheet's complete baseball history data for many analytical frameworks. Includes Postgres, cstore_fdw, MySQL, SQLite, Clickhouse, Drill, Parquet, and CSV.
Apache License 2.0
115 stars 16 forks source link

premission error in build script #60

Closed double-dose-larry closed 3 years ago

double-dose-larry commented 3 years ago

Describe the bug Can't get the db to build.

To Reproduce docker run --name postgres-cstore-fdw -d -p 5433:5432 -e POSTGRES_PASSWORD="postgres" doublewick/boxball:postgres-cstore-fdw-latest

Expected behavior I want the built database to be inside the container, but when I take out the -v flag on the docker run command I'm hit with the directory not empty error. I expect the postgres db to exists in /var/lib/postgresql/data inside the container.

Error Message

initdb: error: directory "/var/lib/postgresql/data" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "/var/lib/postgresql/data" or run initdb
with an argument other than "/var/lib/postgresql/data".

Desktop (please complete the following information): docker desktop on window 10

double-dose-larry commented 3 years ago

So there is some sort of .cnf file in /var/lib/postgresql/data that is preventing the script from continuing. As a work around I passed a new path in the PGDATA environment variable.

full docker command:

docker run --name retro20 -d -p 5433:5432 -e POSTGRES_PASSWORD="postgres" -e PGDATA="/var/lib/postgresql/retro20" doublewick/boxball:postgres-cstore-fdw-latest

I'm going to close this issue, but maybe you should look into it. Seems like an easy fix.