Docker如何安裝PostgreSQL
dockerhub網(wǎng)址
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”,是一種對象關(guān)系數(shù)據(jù)庫管理系統(tǒng)(ORDBMS),強調(diào)可擴展性和符合標準。作為數(shù)據(jù)庫服務(wù)器,它的主要功能是安全地存儲數(shù)據(jù)并支持最佳實踐,然后根據(jù)其他軟件應(yīng)用程序(無論是同一臺計算機上的應(yīng)用程序還是在網(wǎng)絡(luò)(包括互聯(lián)網(wǎng))上另一臺計算機上運行的應(yīng)用程序)的要求檢索數(shù)據(jù)。它可以處理從小型單機應(yīng)用程序到擁有眾多并發(fā)用戶的大型互聯(lián)網(wǎng)應(yīng)用程序等各種工作負載。最新版本還提供了數(shù)據(jù)庫本身的復(fù)制功能,以提高安全性和可擴展性。
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標準的大部分內(nèi)容,符合ACID標準并具有事務(wù)性(包括大多數(shù)DDL語句),可使用多版本并發(fā)控制(MVCC)避免鎖定問題,提供對臟讀取的免疫力和完全的序列化能力;使用其他數(shù)據(jù)庫所不具備的多種索引方法處理復(fù)雜的SQL查詢;具有可更新視圖和物化視圖、觸發(fā)器、外鍵;支持函數(shù)和存儲過程以及其他可擴展性,并擁有大量由第三方編寫的擴展程序。除了可以與主要的專有數(shù)據(jù)庫和開放源碼數(shù)據(jù)庫一起使用外,PostgreSQL 還支持從這些數(shù)據(jù)庫遷移,因為它支持大量標準 SQL 語句,并有可用的遷移工具。如果使用了專有擴展,PostgreSQL 的可擴展性可以通過一些內(nèi)置和第三方開源兼容擴展(如 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 # 設(shè)置容器名
-e POSTGRES_PASSWORD=PGdata@456 # 設(shè)置密碼
-p 5432:5432 # 設(shè)置訪問端口
-v /data/postgres/postgresql/data:/var/lib/postgresql/data # 將容器中的數(shù)據(jù)掛載到本地
-d postgres:12.17 #選擇鏡像
密碼:PGdata@456
到此這篇關(guān)于Docker如何安裝PostgreSQL的文章就介紹到這了,更多相關(guān)Docker安裝PostgreSQL內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Docker鏡像如何移動或復(fù)制到另一臺服務(wù)器
文章介紹了如何在不同服務(wù)器之間移動或復(fù)制Docker鏡像,包括使用dockersave和dockerload、DockerRegistry、以及dockerexport和dockerimport命令的方法2025-02-02Docker Gitlab+Jenkins+Harbor構(gòu)建持久化平臺操作
這篇文章主要介紹了Docker Gitlab+Jenkins+Harbor構(gòu)建持久化平臺操作,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-11-11Docker Overlay2磁盤空間占用過大清理的方法實現(xiàn)
隨著業(yè)務(wù)量的不斷增大,容器的不斷啟動,往往會出現(xiàn)磁盤空間不足,本文主要介紹了Docker Overlay2磁盤空間占用過大清理的方法實現(xiàn),感興趣的可以了解一下2022-03-03基于Docker部署Tomcat集群、 Nginx負載均衡的問題小結(jié)
這篇文章主要介紹了基于Docker部署 Tomcat集群、 Nginx負載均衡,本文給大家介紹的非常詳細,對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下2021-09-09