-
Notifications
You must be signed in to change notification settings - Fork 702
edits #3114
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
edits #3114
Conversation
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.
Pull request overview
This PR optimizes the Postgres Docker image build process by improving package installation practices and pre-configuring the pg_deeplake extension. The changes reduce image size and eliminate the need for runtime extension initialization.
Changes:
- Replaced generic BASE_IMAGE with specific postgres:18 base image
- Added --no-install-recommends and --no-cache-dir flags to reduce image size
- Pre-installed pg_deeplake extension in template1 database during build
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
postgres/Dockerfile
Outdated
| RUN apt-get install --no-install-recommends -y /tmp/debs/pg-deeplake-${VERSION}_${TARGETARCH}.deb && rm -rf /tmp/debs/ \ | ||
| su postgres -c "psql --username postgres <<'EOF' \ | ||
| \\c template1; \ | ||
| CREATE EXTENSION IF NOT EXISTS pg_deeplake; \ | ||
| EOF"; |
Copilot
AI
Jan 16, 2026
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.
The multi-line RUN command uses backslash continuation but combines apt-get install with su/psql execution. If the extension creation fails, the apt-get install will still succeed, potentially masking errors. Consider splitting into separate RUN commands or adding error handling between the install and extension creation steps.
| RUN apt-get install --no-install-recommends -y /tmp/debs/pg-deeplake-${VERSION}_${TARGETARCH}.deb && rm -rf /tmp/debs/ \ | |
| su postgres -c "psql --username postgres <<'EOF' \ | |
| \\c template1; \ | |
| CREATE EXTENSION IF NOT EXISTS pg_deeplake; \ | |
| EOF"; | |
| RUN apt-get install --no-install-recommends -y /tmp/debs/pg-deeplake-${VERSION}_${TARGETARCH}.deb && rm -rf /tmp/debs/ | |
| RUN su postgres -c "psql --username postgres -d template1 -c 'CREATE EXTENSION IF NOT EXISTS pg_deeplake;'" |
postgres/Dockerfile
Outdated
| RUN apt-get install --no-install-recommends -y /tmp/debs/pg-deeplake-${VERSION}_${TARGETARCH}.deb && rm -rf /tmp/debs/ \ | ||
| su postgres -c "psql --username postgres <<'EOF' \ |
Copilot
AI
Jan 16, 2026
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.
The command uses backslash for line continuation immediately followed by su postgres -c without the && operator. This creates unclear execution flow. Add && before the su command to ensure the extension creation only runs if the package installation succeeds.
|
|
Your Name seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |



🚀 🚀 Pull Request
Impact
Description
Things to be aware of
Things to worry about
Additional Context