File: Dockerfile

package info (click to toggle)
pg-auto-failover 2.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,368 kB
  • sloc: ansic: 58,369; python: 5,515; sql: 3,177; makefile: 629; sh: 35
file content (62 lines) | stat: -rw-r--r-- 1,982 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
FROM debian:bullseye-slim

ARG PGVERSION=14
ARG CITUS=postgresql-14-citus-11.1

RUN apt-get update \
  && apt-get install -y --no-install-recommends \
     ca-certificates \
     gnupg \
     make \
     curl \
     sudo \
     tmux \
     watch \
     lsof \
     psutils \
     postgresql-common \
     libpq-dev \
  && rm -rf /var/lib/apt/lists/*

# we use apt.postgresql.org
RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.list
RUN echo "deb-src http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.src.list

# bypass initdb of a "main" cluster
RUN echo 'create_main_cluster = false' | sudo tee -a /etc/postgresql-common/createcluster.conf
RUN apt-get update \
  && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
    postgresql-${PGVERSION} \
    postgresql-server-dev-${PGVERSION} \
  && rm -rf /var/lib/apt/lists/*

# See https://packagecloud.io/citusdata/community/install
RUN curl -s https://packagecloud.io/install/repositories/citusdata/community/script.deb.sh | sudo bash

RUN apt-get update \
  && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
	postgresql-${PGVERSION} \
    ${CITUS} \
  && rm -rf /var/lib/apt/lists/*

RUN adduser --disabled-password --gecos '' docker
RUN adduser docker sudo
RUN adduser docker postgres
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# build pg_auto_failover from local sources
RUN apt-get update \
  && apt-get build-dep -y --no-install-recommends postgresql-${PGVERSION} \
  && rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/pg_auto_failover

COPY Makefile ./
COPY Makefile.azure ./
COPY Makefile.citus ./
COPY src/ ./src
RUN make -s clean && make -s install -j8
RUN cp /usr/lib/postgresql/${PGVERSION}/bin/pg_autoctl /usr/local/bin

USER docker
ENV PG_AUTOCTL_DEBUG 1