Public Repository

Last pushed: a month ago
Short Description
Docker image of PostgreSQL installed on CentOS6.8
Full Description
1. Pull the Docker image to local machine
docker pull cwds/postgresql

Pulls the docker image with postgresql-9.5 installed by default.

2. Start the PostgreSQL docker container in daemon mode
docker run -it -d --name=<user defined postgresql name> -p 5432:5432 cwds/postgresql
  • -p 5432:5432 exposes port 5432 to allow connections from the host
    The default postgres user has been created in the entrypoint with initdb.
3. Attach the container and Start postgres
To access the console, attach to the docker container
docker exec -it <container ID / Name of the container> bash
Connect to the data base
psql -h localhost -U postgres

once after the container is configured exit from the container by keeping the container in running mode

CTRL + P + Q

Postgresql - API

Postgresql for the API builds

1. Pull the docker image to the local machine
Docker pull cwds/postgresql:api

Pulls the Docker image with Postgresql for the API

2. Start the Container in Docker daemon mode
docker run -it -d --name=<user defined postgresql name> -p 5432:5432 cwds/postgresql:api
  • -p 5432:5432 exposes port 5432 to allow connections from the host
  • --name=some_name set a name of the container of your choice. Example --name=postgres.

After successfully running the postgresql and db2 container in the daemon mode access the API application in the browser

 http://API_host:8080/application
Docker Pull Command
Owner
cwds

Comments (0)