I make a Dockerfile as:
FROM postgres:latest
# step 1: Install dependencies
RUN apt-get update &&
apt-get install -y build-essential git curl pkg-config libssl-dev libclang-dev llvm-dev &&
apt-get clean &&
rm -rf /var/lib/apt/lists/*
# step 2: Install Rust and cargo-pgrx
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y &&
echo 'source $HOME/.cargo/env' >> $HOME/.bashrc &&
/bin/bash -c "source $HOME/.cargo/env && cargo install cargo-pgrx --version 0.10.2 --locked"
# step 3: Debugging step to check if cargo is installed
RUN /bin/bash -c "source $HOME/.cargo/env && cargo --version"
# step 4: Debugging step to check if git is installed
RUN git --version
# step 5: Clone the repository and build
RUN /bin/bash -c "source $HOME/.cargo/env &&
git clone https://github.com/tensorchord/pg_bestmatch.rs.git &&
cd pg_bestmatch.rs &&
export RUST_BACKTRACE=full &&
cargo pgrx init --verbose &&
cargo pgrx install --verbose"
And, I got stuck in step 5, the below is the log:
> [6/7] RUN /bin/bash -c "source $HOME/.cargo/env && git clone https://github.com/tensorchord/pg_bestmatch.rs.git && cd pg_bestmatch.rs && export RUST_BACKTRACE=full && cargo pgrx init --verbose && cargo pgrx install --verbose":
108.3 12: std::sys::backtrace::__rust_begin_short_backtrace::h42629a699b07f548
108.3 at <unknown source file>:<unknown line>
108.3 13: core::ops::function::FnOnce::call_once{{vtable.shim}}::h3bc5f5760445af8a
108.3 at <unknown source file>:<unknown line>
108.3 14: std::sys::pal::unix::thread::Thread::new::thread_start::ha8af9c992ef0b208
108.3 at <unknown source file>:<unknown line>
108.3 15: __clone<unknown>
108.3 at <unknown source file>:<unknown line>
108.3
108.3 Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
------
Anyone know how to fix that please share.
Try with docker build, to get docker of postgresql and a pg_bestmatch.rs extension.
3