mirror of
https://github.com/simon987/pg_hamming.git
synced 2025-04-10 14:06:44 +00:00
docker
This commit is contained in:
parent
21403845aa
commit
e32ba92aa7
16
Dockerfile
Normal file
16
Dockerfile
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
FROM ubuntu:20.04 as build
|
||||||
|
|
||||||
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
RUN apt update
|
||||||
|
RUN apt install -y cmake postgresql-server-dev-12 -y
|
||||||
|
|
||||||
|
WORKDIR /build/
|
||||||
|
COPY . /build/
|
||||||
|
|
||||||
|
RUN cmake .
|
||||||
|
|
||||||
|
FROM postgres:12
|
||||||
|
|
||||||
|
COPY --from=build /build/libhamming.so /usr/lib/libhamming.so
|
||||||
|
COPY install.sh /docker-entrypoint-initdb.d/init-user-db.sh
|
@ -1,12 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
mv libhamming.so /usr/lib/
|
|
||||||
|
|
||||||
USER=postgres
|
|
||||||
DATABASE=imhashdb
|
|
||||||
LIB_PATH="'/usr/lib/libhamming.so'"
|
LIB_PATH="'/usr/lib/libhamming.so'"
|
||||||
|
|
||||||
psql -U $USER $DATABASE <<EOF
|
psql -U $POSTGRES_USER $POSTGRES_DB <<EOF
|
||||||
CREATE OR REPLACE FUNCTION hash_is_within_distance8(bytea, bytea, integer) RETURNS boolean
|
CREATE OR REPLACE FUNCTION hash_is_within_distance8(bytea, bytea, integer) RETURNS boolean
|
||||||
AS $LIB_PATH, 'hash_is_within_distance8' LANGUAGE C STRICT;
|
AS $LIB_PATH, 'hash_is_within_distance8' LANGUAGE C STRICT;
|
||||||
CREATE OR REPLACE FUNCTION hash_is_within_distance32(bytea, bytea, integer) RETURNS boolean
|
CREATE OR REPLACE FUNCTION hash_is_within_distance32(bytea, bytea, integer) RETURNS boolean
|
||||||
|
Loading…
x
Reference in New Issue
Block a user