docker build -t postrep .
docker rmi $(docker images | grep "^<none>" | awk '{print $3}')
docker run -d --name master postrep
docker run -d --name slave -e SLAVE=<master_ip> postrep
docker exec -it -u postgres slave bash -c 'pg_ctl promote'
docker logs slave
docker exec -it -u postgres master bash -c 'echo "select * from pg_stat_replication;" |psql'
docker exec -it -u postgres slave bash -c 'echo "select now()-pg_last_xact_replay_timestamp();" |psql'