title: Disable postgres from listening on IPv6
body: <p>I created a postgres docker image on top of the official image to copy my own <code>pg_hba.conf</code> into it, because I need to disable listening on IPv6 :</p>
  <pre><code>FROM postgres:13
  COPY pg_hba.conf /etc/
  </code></pre>
  <p>Afterwards I run the container using the following docker-compose.yaml:</p>
  <pre><code>postgres:
      image: custom-postgres
      command: postgres -c hba_file=&quot;/etc/pg_hba.conf&quot;
  </code></pre>
  <p>But postgres still tries listening on the none existent IPv6 socket. What am I doing wrong? This is my <code>pg_hba.conf</code>:</p>
  <pre><code># TYPE  DATABASE        USER            ADDRESS                 METHOD
  
  # &quot;local&quot; is for Unix domain socket connections only
  local   all             all                                     trust
  # IPv4 local connections:
  host    all             all             127.0.0.1/32            trust
  # Allow replication connections from localhost, by a user with the
  # replication privilege.
  local   replication     all                                     trust
  host    replication     all             127.0.0.1/32            trust
  </code></pre>
  <p>But I get the feeling it is not beeing used as I can see that the default <code>pg_hba.conf</code> is still created in <code>/var/lib/postgresql/data</code></p>