forked from dimitri/pgcopydb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
88 lines (75 loc) · 1.83 KB
/
Dockerfile
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# syntax=docker/dockerfile:latest
# Define a base image with all our build dependencies.
FROM --platform=${TARGETPLATFORM} debian:11-slim as build
# multi-arch
ARG TARGETPLATFORM
ARG TARGETOS
ARG TARGETARCH
RUN dpkg --add-architecture ${TARGETARCH:-arm64} && apt update \
&& apt install -qqy --no-install-recommends \
libncurses-dev \
libxml2-dev \
sudo \
valgrind \
build-essential \
libedit-dev \
libicu-dev \
libkrb5-dev \
liblz4-dev \
libncurses6 \
libpam-dev \
libpq-dev \
libpq5 \
libreadline-dev \
libselinux1-dev \
libssl-dev \
libxslt1-dev \
lsof \
psmisc \
gdb \
strace \
tmux \
watch \
make \
openssl \
postgresql-common \
postgresql-client-common \
postgresql-server-dev-all \
psutils \
tmux \
watch \
zlib1g-dev
WORKDIR /usr/src/pgcopydb
COPY . .
RUN make -s clean && make -s -j$(nproc) install
# Now the "run" image, as small as possible
FROM --platform=${TARGETPLATFORM} debian:11-slim as run
# multi-arch
ARG TARGETPLATFORM
ARG TARGETOS
ARG TARGETARCH
# used to configure Github Packages
LABEL org.opencontainers.image.source https://github.com/dimitri/pgcopydb
RUN dpkg --add-architecture ${TARGETARCH:-arm64} && apt update \
&& apt install -qqy --no-install-suggests --no-install-recommends \
sudo \
passwd \
ca-certificates \
libpq5 \
lsof \
tmux \
watch \
psmisc \
openssl \
postgresql-common \
postgresql-client \
postgresql-client-common \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -rm -d /var/lib/postgres -s /bin/bash -g postgres -G sudo docker
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
COPY --from=build --chmod=755 /usr/lib/postgresql/13/bin/pgcopydb /usr/local/bin
USER docker
ENTRYPOINT []
CMD []
HEALTHCHECK NONE