-
Notifications
You must be signed in to change notification settings - Fork 56
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
Pre-configure docker image to use pg_duckdb #305
Conversation
This slightly modifies the default Postgres docker image so that when it initializes the database it will automatically configure `pg_duckdb`.
945f051
to
81e4773
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
9f800a6
to
592fd90
Compare
…, useful for psql
@@ -50,4 +56,10 @@ RUN make installcheck | |||
### | |||
# this creates a usable postgres image but without the packages needed to build | |||
FROM base AS output | |||
|
|||
# Automatically enable pg_duckdb | |||
RUN echo "shared_preload_libraries='pg_duckdb'" >> /usr/share/postgresql/postgresql.conf.sample |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, I didnt think that you could make changes to the sample file (you know, it being named "sample" and all) and it would get picked up somehow later. TIL. 😂 I think it's still nice to be able to inject a config file for other purposes (like motherduck token) via docker-compose, but if this means that the image works without doing so, then great! 👍
|
||
# Automatically enable pg_duckdb | ||
RUN echo "shared_preload_libraries='pg_duckdb'" >> /usr/share/postgresql/postgresql.conf.sample | ||
RUN echo "CREATE EXTENSION IF NOT EXISTS pg_duckdb;" >> /docker-entrypoint-initdb.d/0001-install-pg_duckdb.sql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably okay to do here. I was only hesitant to do so in case some users want to opt out of this behavior, doing so this way means they need to make their own image which removes this file. But if we get push back it can always be removed.
This slightly modifies the default Postgres docker image so that when it initializes the database it will automatically configure
pg_duckdb
. It also uses thepostgres
user to start the container, so thatdocker exec ... psql
just works without having to specify-U postgres
This also uses a more selective COPY. I often have some random stuff in my top repo directory, such as gigabytes of TPCDS csv files. This makes sure those are not copied into the container.