Sign inSign up

opavlova/db-postgres

By opavlova

•Updated about 10 years ago

The PostgreSQL object-relational database system

Image
0

892

opavlova/db-postgres repository overview

⁠PostgreSQL database

⁠Image tags

 opavlova/db-postgres:9.6
 opavlova/db-postgres:9.5
 opavlova/db-postgres:9.4
 opavlova/db-postgres:9.3
 opavlova/db-postgres:9.2
 opavlova/db-postgres:9.1

⁠Usage

⁠How to connect to a container with DB in IntelliJ IDEA using a Dockerfile
  1. Install docker https://docs.docker.com/engine/installation/⁠ https://docs.docker.com/engine/userguide/⁠

  2. Add Docker support https://www.jetbrains.com/help/idea/docker.html⁠

  3. Create a Dockerfile with the following content in IntelliJ IDEA:

FROM  opavlova/db-postgres:9.6
  1. Create and run a New Run Configuration

    click on the "Run on Docker' gutter (near "FROM" in the Editor)  -> choose "New Run Configuration"
    enter "-p 15432:5432"   into the  "Run options" field 
    Run  ( results are in the Services View )
    
  2. Create a connection to the database in the Database View:

    go to the Database View, add new Data Source
    add URL:  add the URL:  jdbc:postgresql://localhost:15432/DOCKERDB
    add user=root, password - empty
    Connect.
    
⁠How to connect to a container with DB in IntelliJ IDEA using an image
  1. Go to the Services View

  2. Connect to Docker

  3. Pull the image Select "Images" item Enter "opavlova/db-postgres:9.6"
    Press ctrl+click to pull the image

  4. Run a container Select the pulled image in the list of images->Call context menu->Create Container Enter "-p 15432:5432" into the "Run options" field in the opened Docker Run Configuration (where port binding: "-p :") Run

  5. Create a connection to the database in the Database View:

    go to the Database View, add new Data Source
    add URL:  add the URL:  jdbc:postgresql://localhost:15432/DOCKERDB
    add user=root, password - empty
    Connect.
    
⁠How to connect to a container with DB in IntelliJ IDEA using Docker Compose
  1. Create a new docker-compose.yml file with the following content:
  db:
    image: "opavlova/db-postgres:9.6"
    ports:
        - "15432:5432"
  1. Run it by clicking on the "Run on Docker' gutter (near "services" in the Editor) Results are in the Services View.

  2. Create a connection to the database in the Database View:

    go to the Database View, add new Data Source
    add URL:  add the URL:  jdbc:postgresql://localhost:15432/DOCKERDB
    add user=root, password - empty
    Connect.
    

Dockerfiles for opavlova/db-postgres images: https://github.com/IdeaUJetBrains/DockerFiles/tree/master/docker-dir/db/postgres/⁠

Tag summary

Content type

Image

Digest

Size

105.8 MB

Last updated

about 10 years ago

docker pull opavlova/db-postgres:9.5