FROM golang:1.13-buster AS builder ARG STOLON_VERSION WORKDIR /stolon RUN git clone https://github.com/sorintlab/stolon . RUN git pull && git checkout ${STOLON_VERSION} RUN go mod download COPY 0001-Add-max-rate-to-pg_basebackup.patch . RUN git apply 0001-Add-max-rate-to-pg_basebackup.patch RUN make && chmod +x /stolon/bin/* FROM postgres:13.3-buster COPY --from=builder /stolon/bin /usr/local/bin ENTRYPOINT [] CMD ["/bin/bash"]