pg_basebackup: could not connect to server: fe_sendauth: no password supplied
Your issue is that your .pgpass file is missing the database field, and all fields are required (although you can use it * for any match). As you are using pg_basebackup (that uses the replication protocol), you need supply that as "replication":

cat &gt; ~/.pgpass &lt;&lt;EOS
${MASTER_PORT_5432_TCP_ADDR}:5432:replication:${REP_USER}:${REP_PASS}
EOS
...


Using * for the database field would work too, but replication is more strict.