title: Can not connect to Postgres Container from pgAdmin
body: <p>related posts:
  1) <a href="https://stackoverflow.com/questions/25540711/docker-postgres-pgadmin-local-connection">docker postgres pgadmin local connection</a></p>
  
  <p>2) <a href="https://coderwall.com/p/qsr3yq/postgresql-with-docker-on-os-x" rel="nofollow noreferrer">https://coderwall.com/p/qsr3yq/postgresql-with-docker-on-os-x</a> (in the example "Name" entry is not filled in)</p>
  
  <p>there are two ways to complete this task, I use official postgres</p>
  
  <p>METHOD 1:</p>
  
  <p>and runs it with</p>
  
  <pre><code>sudo docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d postgres
  </code></pre>
  
  <p>then connect with</p>
  
  <pre><code>Name: postgres
  Host: localhost
  Port: 5432
  user
  pass
  ...
  </code></pre>
  
  <p>METHOD 2:</p>
  
  <p>starts with </p>
  
  <pre><code>sudo docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
  </code></pre>
  
  <p>and then check the ip of container</p>
  
  <pre><code>sudo docker inspect
  </code></pre>
  
  <p>say result</p>
  
  <pre><code>172.17.42.1
  </code></pre>
  
  <p>then connect with pgAdmin tab Properties filled info</p>
  
  <pre><code>Name: postgres
  Host: 172.17.42.1
  Port: 5432
  user
  pass
  ...
  </code></pre>