Skip to content

Commit

Permalink
v0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
larsw committed Apr 22, 2024
1 parent d6e3c70 commit 79e9e05
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ Cargo.lock
bin/
pkg/
wasm-pack.log
out/

19 changes: 19 additions & 0 deletions 10_accumulo_access.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -e

# Perform all actions as $POSTGRES_USER
export PGUSER="$POSTGRES_USER"

# Create the 'template_accumulo_access' template db
"${psql[@]}" <<- 'EOSQL'
CREATE DATABASE template_accumulo_access IS_TEMPLATE true;
EOSQL

# Load accumulo_access_pg into both template_database and $POSTGRES_DB
for DB in template_accumulo_access "$POSTGRES_DB"; do
echo "Loading accumulo_access_pg extension into $DB"
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
CREATE EXTENSION IF NOT EXISTS accumulo_access_pg;
EOSQL
done
7 changes: 2 additions & 5 deletions Dockerfile → Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,5 @@ RUN cd target/artifacts/accumulo_access_pg-pg15 && \
-a amd64 \
.

FROM postgis/postgis:15-3.4 AS runtime

COPY --from=build /tmp/accumulo_access_bullseye_pg15_0.1.0_amd64.deb /tmp/
ADD 10_postgis.sh /docker-entrypoint-initdb.d/
RUN apt install -y /tmp/accumulo_access_bullseye_pg15_0.1.0_amd64.deb
FROM scratch
COPY --from=build /tmp/accumulo_access_bullseye_pg15_0.1.0_amd64.deb /
11 changes: 11 additions & 0 deletions Dockerfile.postgis
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM postgis/postgis:15-3.4 AS runtime

LABEL maintainer="Lars Wilhelmsen <[email protected]>" \
org.opencontainers.image.description=" PostgreSQL 15 bullseye with accumulo_access_pg database extension" \
org.opencontainers.image.source="https://github.com/larsw/accumulo_access_pg"

ADD out/accumulo_access_bullseye_pg15_0.1.0_amd64.deb /tmp/
RUN apt install -y /tmp/accumulo_access_bullseye_pg15_0.1.0_amd64.deb
# Overwrite the file provided by PostGIS with one that includes accumulo_access_pg
ADD 10_postgis.sh /docker-entrypoint-initdb.d/

9 changes: 9 additions & 0 deletions Dockerfile.postgres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM postgis/postgis:15-3.4 AS runtime

LABEL maintainer="Lars Wilhelmsen <[email protected]>" \
org.opencontainers.image.description="PostGIS 3.4.2+dfsg-1.pgdg110+1 spatial database extension AND accumulo_access_pg with PostgreSQL 15 bullseye" \
org.opencontainers.image.source="https://github.com/larsw/accumulo_access_pg"

ADD out/accumulo_access_bullseye_pg15_0.1.0_amd64.deb /tmp/
RUN mkdir -p /docker-entrypoint-initdb.d && apt install -y /tmp/accumulo_access_bullseye_pg15_0.1.0_amd64.deb
ADD 10_accumulo_access.sh /docker-entrypoint-initdb.d/
7 changes: 7 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

docker build -f Dockerfile.build -o out .
docker build -f Dockerfile.postgres -t larsw/postgres-accumulo-access:15.6-bullseye .
docker tag larsw/postgres-accumulo-access:15.6-bullseye larsw/postgres-accumulo-access:latest
docker build -f Dockerfile.postgis -t larsw/postgis-accumulo-access:15-3.4 .
docker tag larsw/postgis-accumulo-access:15-3.4 larsw/postgis-accumulo-access:latest

0 comments on commit 79e9e05

Please sign in to comment.