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