2021-03-29 11:13:57 -07:00
|
|
|
# Postgres Container
|
|
|
|
|
#
|
2022-02-22 14:30:05 -08:00
|
|
|
# Copyright (c) 2021-2022 Cisco Systems, Inc. and others. All rights reserved.
|
2021-03-29 11:13:57 -07:00
|
|
|
#
|
|
|
|
|
# Build:
|
2022-06-08 11:53:55 -07:00
|
|
|
# DOCKER_BUILDKIT=1 docker build --platform linux/amd64 \
|
|
|
|
|
# --build-arg VERSION=2.2.0 \
|
|
|
|
|
# --squash \
|
|
|
|
|
# -t openbmp/postgres:2.2.0 .
|
2021-03-29 11:13:57 -07:00
|
|
|
#
|
|
|
|
|
# Run:
|
|
|
|
|
# docker run --rm -it -p 5432:5432 \
|
|
|
|
|
# -e POSTGRES_PASSWORD=openbmp \
|
|
|
|
|
# -e POSTGRES_USER=openbmp \
|
|
|
|
|
# -e POSTGRES_DB=openbmp \
|
2022-06-08 11:53:55 -07:00
|
|
|
# openbmp/postgres:2.2.0
|
2021-03-29 11:13:57 -07:00
|
|
|
|
2022-03-15 18:10:20 -05:00
|
|
|
# -----------------------------------------------
|
|
|
|
|
# stage: Build
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
# stage: Final container
|
|
|
|
|
# -----------------------------------------------
|
2022-06-12 11:04:59 -07:00
|
|
|
FROM timescale/timescaledb-ha:pg14-ts2.7-latest
|
|
|
|
|
|
2022-06-08 11:53:55 -07:00
|
|
|
ARG VERSION=0.0.0
|
2022-03-15 18:10:20 -05:00
|
|
|
|
2022-06-08 11:53:55 -07:00
|
|
|
ENV PGDATA=/var/lib/postgresql/data
|
|
|
|
|
ENV PGDATA_TS=/var/lib/postgresql/ts/data
|
2021-03-29 11:13:57 -07:00
|
|
|
|
2021-03-30 14:25:24 -07:00
|
|
|
# Expected data locations for base tables and timeseries
|
|
|
|
|
#
|
|
|
|
|
VOLUME ["/var/lib/postgresql/data"]
|
|
|
|
|
VOLUME ["/var/lib/postgresql/ts"]
|
|
|
|
|
|
2022-06-08 11:53:55 -07:00
|
|
|
ADD --chmod=755 scripts/004_obmp_psql_cfg.sh /docker-entrypoint-initdb.d/004_obmp_psql_cfg.sh
|
|
|
|
|
ADD --chmod=755 scripts/005_obmp_init.sh /docker-entrypoint-initdb.d/005_obmp_init.sh
|
|
|
|
|
|
|
|
|
|
USER root
|
2021-03-29 11:13:57 -07:00
|
|
|
|
2022-06-08 11:53:55 -07:00
|
|
|
RUN rm -rf /usr/lib/postgresql/12 /usr/lib/postgresql/13 \
|
|
|
|
|
&& mkdir -p /var/lib/postgresql/data /var/lib/postgresql/ts/data \
|
2022-06-12 11:04:59 -07:00
|
|
|
&& chown -R postgres /var/lib/postgresql/data /var/lib/postgresql/ts/data \
|
|
|
|
|
&& mkdir -p /usr/local/openbmp \
|
|
|
|
|
&& touch /usr/local/openbmp/version-${VERSION}
|
2022-03-15 13:08:48 -05:00
|
|
|
|
2022-06-08 11:53:55 -07:00
|
|
|
USER postgres
|