Docker如何安裝PostgreSQL
dockerhub網址


What is PostgreSQL?
PostgreSQL, often simply “Postgres”, is an object-relational database management system (ORDBMS) with an emphasis on extensibility and standards-compliance. As a database server, its primary function is to store data, securely and supporting best practices, and retrieve it later, as requested by other software applications, be it those on the same computer or those running on another computer across a network (including the Internet). It can handle workloads ranging from small single-machine applications to large Internet-facing applications with many concurrent users. Recent versions also provide replication of the database itself for security and scalability.
PostgreSQL 通常簡稱為 “Postgres”,是一種對象關系數據庫管理系統(tǒng)(ORDBMS),強調可擴展性和符合標準。作為數據庫服務器,它的主要功能是安全地存儲數據并支持最佳實踐,然后根據其他軟件應用程序(無論是同一臺計算機上的應用程序還是在網絡(包括互聯(lián)網)上另一臺計算機上運行的應用程序)的要求檢索數據。它可以處理從小型單機應用程序到擁有眾多并發(fā)用戶的大型互聯(lián)網應用程序等各種工作負載。最新版本還提供了數據庫本身的復制功能,以提高安全性和可擴展性。
PostgreSQL implements the majority of the SQL:2011 standard, is ACID-compliant and transactional (including most DDL statements) avoiding locking issues using multiversion concurrency control (MVCC), provides immunity to dirty reads and full serializability; handles complex SQL queries using many indexing methods that are not available in other databases; has updateable views and materialized views, triggers, foreign keys; supports functions and stored procedures, and other expandability, and has a large number of extensions written by third parties. In addition to the possibility of working with the major proprietary and open source databases, PostgreSQL supports migration from them, by its extensive standard SQL support and available migration tools. And if proprietary extensions had been used, by its extensibility that can emulate many through some built-in and third-party open source compatibility extensions, such as for Oracle.
PostgreSQL執(zhí)行了SQL:2011標準的大部分內容,符合ACID標準并具有事務性(包括大多數DDL語句),可使用多版本并發(fā)控制(MVCC)避免鎖定問題,提供對臟讀取的免疫力和完全的序列化能力;使用其他數據庫所不具備的多種索引方法處理復雜的SQL查詢;具有可更新視圖和物化視圖、觸發(fā)器、外鍵;支持函數和存儲過程以及其他可擴展性,并擁有大量由第三方編寫的擴展程序。除了可以與主要的專有數據庫和開放源碼數據庫一起使用外,PostgreSQL 還支持從這些數據庫遷移,因為它支持大量標準 SQL 語句,并有可用的遷移工具。如果使用了專有擴展,PostgreSQL 的可擴展性可以通過一些內置和第三方開源兼容擴展(如 Oracle)來模擬許多擴展。
下載PostgreSQL
docker pull postgres:12.17

創(chuàng)建映射路徑
mkdir -p /data/postgres/postgresql/data
啟動容器
docker run --name postgres1217 -e POSTGRES_PASSWORD=PGdata@456 -p 5432:5432 -v /data/postgres/postgresql/data:/var/lib/postgresql/data -d postgres:12.17
命令解釋
docker run # 創(chuàng)建容器
–name postgres # 設置容器名
-e POSTGRES_PASSWORD=PGdata@456 # 設置密碼
-p 5432:5432 # 設置訪問端口
-v /data/postgres/postgresql/data:/var/lib/postgresql/data # 將容器中的數據掛載到本地
-d postgres:12.17 #選擇鏡像
密碼:PGdata@456


到此這篇關于Docker如何安裝PostgreSQL的文章就介紹到這了,更多相關Docker安裝PostgreSQL內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
相關文章
ubuntu系統(tǒng)中無法拉取docker鏡像的問題及解決
作者遇到的docker拉取mysql8.0鏡像失敗的問題,通過更換鏡像加速器、更新配置、診斷DNS解析問題等步驟,最終成功使用DaoCloud鏡像站拉取鏡像,作者分享了解決問題的過程和經驗,對遇到類似問題的人會有幫助2026-04-04
dockerfile部署前端vue打包的ist文件實戰(zhàn)
這篇文章主要為大家介紹了dockerfile部署前端vue打包的ist文件實戰(zhàn),有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2023-10-10

