Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 757 Bytes

docker-postgres-create.md

File metadata and controls

17 lines (12 loc) · 757 Bytes

Create and run Postgres

docker run -p {{PORT}}:{{PORT}} --name {{CONTAINER_NAME}} -e POSTGRES_DB={{DB_NAME}} -e POSTGRES_USER={{DB_USER_NAME}} -e POSTGRES_PASSWORD={{DB_PASSWORD}} -d postgres

  • PORT: Port on which postgres will be running/accesed
  • CONTAINER_NAME: Name to assign to the container
  • DB_NAME: Databse name which needs to be created.
  • DB_USER_NAME: Username for database login
  • DB_PASSWORD: Password for the above database login user

Example

docker run -p 5432:5432 --name postgres-server -e POSTGRES_DB=ak-cli -e POSTGRES_USER=arshad -e POSTGRES_PASSWORD=arshad -d postgres

Related