Skip to content

Fix pgvector package install & introduce ".dockerignore"#39

Closed
charmitro wants to merge 1 commit intolanterndata:mainfrom
charmitro:dockerignore
Closed

Fix pgvector package install & introduce ".dockerignore"#39
charmitro wants to merge 1 commit intolanterndata:mainfrom
charmitro:dockerignore

Conversation

@charmitro
Copy link
Copy Markdown

@charmitro charmitro commented Aug 9, 2023

In this patch:

  1. Install "postgresql-15-pgvector" instead of "postgres-15-pgvector" since it doesn't exist.
  2. Introduced .dockerignore to avoid:
    • build failures due to "build/" being copied to the build stage
    • avoid copying other out-of-date files (*.so etc.)

Solving the following:

2.909 E: Unable to locate package postgres-15-pgvector
------
Dockerfile.dev:6
--------------------
   5 |     # Set Locale
   6 | >>> RUN apt update && apt-mark hold locales && \
   7 | >>> # Install required packages for build
   8 | >>> apt install -y --no-install-recommends build-essential cmake postgresql-server-dev-15 gdb wget postgres-15-pgvector python3-pip sudo && \
   9 | >>>     pip install libtmux --break-system-packages
  10 |
--------------------
ERROR: failed to solve: process "/bin/sh -c apt update && apt-mark hold locales && apt install -y --no-install-recommends build-essential cmake postgresql-server-dev-15 gdb wget postgres-15-pgvector python3-pip sudo &&     pip install libtmux --break-system-packages" did not complete successfully: exit code: 100
17.67 mkdir: cannot create directory ‘build’: File exists
------
Dockerfile:7
--------------------
   5 |     COPY . /tmp/lanterndb
   6 |
   7 | >>> RUN PG_VERSION=$PG_VERSION ./tmp/lanterndb/ci/scripts/build-docker.sh
   8 |
--------------------
ERROR: failed to solve: process "/bin/sh -c PG_VERSION=$PG_VERSION ./tmp/lanterndb/ci/scripts/build-docker.sh" did not complete successfully: exit code: 1

In this patch:
  1. Install "postgresql-15-pgvector" instead of "postgres-15-pgvector"
     since it doesn't exist.
  2. Introduced .dockerignore to avoid:
       * build failures due to "build/" being copied to the build stage
       * avoid copying other out-of-date files ("*.so" etc.)

Signed-off-by: Charalampos Mitrodimas <charmitro@posteo.net>
@Ngalstyan4
Copy link
Copy Markdown
Contributor

Thanks for your contribution, Charalampos!
I am a little reluctant about adding a .dockerignore file. My understanding is people usually make their Docker images more precise, so the image only copies the necessary files/folders.

Can we do that? COPY only the files and folders that we need in the image in stead of using the COPY . dest wildcard.

@Ngalstyan4
Copy link
Copy Markdown
Contributor

Updated and fixed by #46
Thanks for spotting the issue and for the initial PR!

@Ngalstyan4 Ngalstyan4 closed this Aug 18, 2023
var77 added a commit that referenced this pull request Oct 8, 2024
* Make row locking non-blocking

* Remove unnecessary deref
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

Successfully merging this pull request may close these issues.

3 participants