1、下载 Postgres 镜像 下载最新版本的 Postgres 镜像(默认是 latest 版本): docker pull postgres 如果想要下载其他版本,比如常用的 10 版本的话,在镜像后面指定版本: docker pull postgres:10.21-alpine 2、创建并运行 pgsql 容器 dockerrun-d \ -p 5432:5432 \ -v /my
1. 打开dockerhub查找postgres版本 地址https://registry.hub.docker.com/_/postgres/tags 2.复制需要的版本 docker pull postgres:alpine3.17 复制需要的版本到服务器上执行 3.运行容器 -d 后台运行 postgres_user 默认 postgres 需要更改加上参数 postgres_password 数据库密码 -v 把容器的/var/lib/postgresql/dat...
[root@lei ~]# docker run --name pg_p --restart=always --network=mynet --ip 172.18.12.100 -v /home/pg_p/data:/var/lib/postgresql/data -e POSTGRES_PASSWORD=123456 -p 5432:5432 -d postgres:12.4-alpine 1. 2. 3. 从 [root@lei ~]# mkdir -p /home/pg_s/data [root@lei ~]# d...
docker pull postgres:alpine 2,创建数据卷 我们最好是创建一个数据库以持久化PostgreSQL的数据: docker volume create postgre-data 3,创建并运行容器 执行下列命令: docker run -id--name=postgresql -v postgre-data:/var/lib/postgresql/data -p 5432:5432 -e POSTGRES_PASSWORD=123456 -e LANG=C.UTF-8 p...
docker pull postgres:15.4-alpine3.18 chen@chen:~/nextcloud$ docker pull postgres:15.4-alpine3.18 15.4-alpine3.18: Pulling from library/postgres 96526aa774ef: Pull complete 86da063037d7: Pull complete a93c97be5f7f: Pull complete 9737661d941c: Pull complete ...
version: '3' services: nginx: image: nginx:mainline-alpine command: [nginx, -g, 'daemon off;'] 1. 2. 3. 4. 5. container_name 指定容器名称 compose 的容器名称默认格式:<项目名称_服务名称_序号> 需要自定义容器名称时,可以使用 container_name version: '3' services: nginx: image: nginx:mai...
$ docker pull postgres:13.0 13.0: Pulling from library/postgres bb79b6b2107f: Already exists e3dc51fa2b56: Pull complete f213b6f96d81: Pull complete 2780ac832fde: Pull complete ae5cee1a3f12: Pull complete 95db3c06319e: Pull complete 475ca72764d5: Pull complete 8d602872ecae: Pull compl...
要拉取特定版本的Docker Postgres镜像,可以按照以下步骤进行操作: 打开终端或命令行工具,确保已经安装了Docker。 使用以下命令拉取特定版本的Docker Postgres镜像:docker pull postgres:<版本号>其中,<版本号>是你想要拉取的具体版本号,例如9.6、10.5等。如果不指定版本号,则默认拉取最新版本的镜像。 Docker会自动从Doc...
#https://git.alpinelinux.org/aports/tree/main/postgresql/postgresql.pre-install?h=3.12-stable RUNset -eux; \ addgroup -g 70 -S postgres; \ adduser -u 70 -S -D -G postgres -H -h /var/lib/postgresql -s /bin/sh postgres; \ ...
docker image pull alpine:latest docker image pull ubuntu:latest 这两条命令从 alpine 和 ubuntu 仓库拉取了标有“latest”标签的镜像。 下面来介绍一下如何从官方仓库拉取不同的镜像。 $ docker image pull mongo:3.3.11//该命令会从官方Mongo库拉取标签为3.3.11的镜像$ docker image pull redis:latest//该...