title: How to resolve " driver failed programming external connectivity" in docker-compose?
body: <p>I am using docker@19.03.2 build 6a30dfc) and docker-compose@1.19.0, build 9e633ef.</p>
  
  <p>Given a <code>docker-compose.yml</code> (that used to work fine for a very long time and was unchanged since April 2019) file that only spins up a mariadb container and is supposed to expose the mysql port to the host:</p>
  
  <pre><code>pe-db:
      image: mariadb:10.3
      ports:
          - 3306:3306
      environment:
          MYSQL_DATABASE: dev_db
          MYSQL_PASSWORD: password
          MYSQL_USER: dev
          MYSQL_ROOT_PASSWORD: root_password
  </code></pre>
  
  <p>yet when running:</p>
  
  <pre><code> docker-compose up
  </code></pre>
  
  <p>I am getting the error message:</p>
  
  <pre><code>Recreating fcac8d931b6a_ratepipeline_pe-db_1 ... error
  
  ERROR: for fcac8d931b6a_ratepipeline_pe-db_1  Cannot start service pe-db: driver failed programming external connectivity on endpoint ratepipeline_pe-db_1 (6e649313e4cccd484d0672183cd24daf21c5e8ad3dc1e01fda57d0c942194b6d): Bind for 0.0.0.0:3306 failed: port is already allocated
  
  ERROR: for pe-db  Cannot start service pe-db: driver failed programming external connectivity on endpoint ratepipeline_pe-db_1 (6e649313e4cccd484d0672183cd24daf21c5e8ad3dc1e01fda57d0c942194b6d): Bind for 0.0.0.0:3306 failed: port is already allocated
  ERROR: Encountered errors while bringing up the project.
  </code></pre>
  
  <p>When checking what runs on port <code>3306</code> via: </p>
  
  <pre><code>sudo netstat -nlp | grep 3306
  tcp6       0      0 :::3306                 :::*                    LISTEN      3042/docker-proxy
  </code></pre>
  
  <p>I see the docker-proxy. There is no other mysql database running locally. I can kill the <code>docker-proxy</code> via:</p>
  
  <pre><code>sudo killall docker-proxy
  sudo netstat -nlp | grep 3306
  </code></pre>
  
  <p>and then I see nothing running on port <code>3306</code>. Yet <code>docker-compose up</code> will run into the same error again, claiming port is already in use even though <code>netstat</code> will show no user on the port.</p>
  
  <p>I also tried restarting the docker daemon via</p>
  
  <pre><code> sudo service docker restart
  </code></pre>
  
  <p>and rebooting my system. The issue persists.</p>
  
  <p>How can I fix this issue?</p>