wal2json 2.3 dockerfile

wal2json 发布2.3 版本了,有好多新特性,以下是一个新特性的dokerfile

dockerfile

FROM postgres:11.2 AS build
ENV VERSION 2_3
RUN buildDeps="curl build-essential ca-certificates git pkg-config glib2.0 postgresql-server-dev-$PG_MAJOR" 
    && apt-get update 
    && apt-get install -y --no-install-recommends ${buildDeps} 
    && echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" > /etc/apt/sources.list.d/pgdg.list 
    && curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - 
    && apt-get update 
    && apt-get install -y --no-install-recommends libc++1 postgresql-server-dev-$PG_MAJOR 
    && mkdir -p /tmp/build 
    && curl -o /tmp/build/${VERSIONN}.tar.gz -SL "https://github.com/eulerto/wal2json/archive/wal2json_${VERSION}.tar.gz" 
    && cd /tmp/build/ 
    && tar -xzf /tmp/build/${VERSIONN}.tar.gz -C /tmp/build/ 
    && cd /tmp/build/wal2json-wal2json_${VERSION} 
    && make && make install 
    && cd / 
    && rm -rf /tmp/build 
    && apt-get remove -y --purge ${buildDeps} 
    && apt-get autoremove -y --purge 
    && rm -rf /var/lib/apt/lists/
RUN echo "max_replication_slots = 1" >> /usr/share/postgresql/postgresql.conf.sample
RUN echo "wal_level = logical" >> /usr/share/postgresql/postgresql.conf.sample
 
 

说明

docker 镜像我已经push docker hub 了dalongrong/wal2json:origin-2.3, 一个不好的消息是docker hub 调整免费策略了,免费用户docker 镜像保留
6个月,后边有可能就被删除了。。。。

参考资料

https://github.com/eulerto/wal2json
https://www.docker.com/pricing/retentionfaq

原文地址:https://www.cnblogs.com/rongfengliang/p/13499537.html