From e32ba92aa726bebaec5432175bd4f39e13d1f6e2 Mon Sep 17 00:00:00 2001 From: simon987 Date: Sat, 23 May 2020 14:45:23 -0400 Subject: [PATCH] docker --- Dockerfile | 16 ++++++++++++++++ install.sh | 6 +----- 2 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..af223b0 --- /dev/null +++ b/Dockerfile @@ -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 diff --git a/install.sh b/install.sh index 7da35f6..74961de 100755 --- a/install.sh +++ b/install.sh @@ -1,12 +1,8 @@ #!/usr/bin/env bash -mv libhamming.so /usr/lib/ - -USER=postgres -DATABASE=imhashdb LIB_PATH="'/usr/lib/libhamming.so'" -psql -U $USER $DATABASE <