title: Database in a docker container
body: <p>I'm trying to create a test database, using the postgres docker image, as explained <a href="https://wkrzywiec.medium.com/database-in-a-docker-container-how-to-start-and-whats-it-about-5e3ceea77e50" rel="nofollow noreferrer">here</a></p>
  <p>The difference is that I'm running it using <code>docker run -d --net host --name my-postgres-container my-postgres-image</code>.</p>
  <p>When I try to connect to the db, using Dbeaver, I get <code>FATAL: password authentication failed for user &quot;postgres&quot;</code>. If I try to not use the local host, but map the port as depict in the link, I get <code>Connection Refused</code>. I <a href="https://samiprogramming.medium.com/localhost-postgres-docker-connection-refused-using-pgadmin-a27b91de7342" rel="nofollow noreferrer">read</a> that I should, in that case, replace the localhost by the ip presented when using <code>docker inspect [container id]</code>. But there's nothing there:</p>
  <pre><code>&quot;Networks&quot;: {
                  &quot;host&quot;: {
                      &quot;IPAMConfig&quot;: null,
                      &quot;Links&quot;: null,
                      &quot;Aliases&quot;: null,
                      &quot;NetworkID&quot;: &quot;5f1358819f5ce262fc1ca2ed0d56a77a78601ecd863105d8fad67f2c01aa8606&quot;,
                      &quot;EndpointID&quot;: &quot;&quot;,
                      &quot;Gateway&quot;: &quot;&quot;,
                      &quot;IPAddress&quot;: &quot;&quot;,
                      &quot;IPPrefixLen&quot;: 0,
                      &quot;IPv6Gateway&quot;: &quot;&quot;,
                      &quot;GlobalIPv6Address&quot;: &quot;&quot;,
                      &quot;GlobalIPv6PrefixLen&quot;: 0,
                      &quot;MacAddress&quot;: &quot;&quot;,
                      &quot;DriverOpts&quot;: null
                  }
              }
  </code></pre>
  <p>I don't know how to properly create and connect using this strategy.</p>