当前位置:网站首页>How to deploy PostgreSQL as a docker container

How to deploy PostgreSQL as a docker container

2022-06-12 04:37:00 mikes zhang

 Insert picture description here
PostgreSQL, Also known as Postgres, Is the leading object relational database system . The reason it's popular , Because it is highly consistent with SQL standard , It also contains additional functions that can simplify large-scale processing of complex data sets .

PostgreSQL Using traditional clients - Server architecture , So you need to run it independently of the application code . In this guide , You will deploy PostgreSQL The server instance acts as Docker Containers . This avoids adding packages to your host , And help isolate your database from the rest of the stack . Before proceeding , Please make sure you have installed Docker.

introduction

PostgreSQL stay Docker Hub There is an official image on , It has several different variants . Tags allow you to v9 To v14 The main PostgreSQL Choose between versions , And select the operating system to use as the base image . Provides Alpine、Debian Stretch and Debian Bullseye.

For the purposes of this tutorial , We will use postgres:14 stay Bullseye The provision of PostgreSQL 14 The label of . You are free to choose different versions to meet your requirements .

docker run Start with the following command PostgreSQL Containers :

docker run -d \
    --name postgres \
    -p 5432:5432
    -e POSTGRES_PASSWORD=<password> \
    -v postgres
原网站

版权声明
本文为[mikes zhang]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203010944043132.html