【问题标题】:How to change postgresql.conf from Postgres docker image如何从 Postgres docker 映像更改 postgresql.conf
【发布时间】:2016-06-05 14:32:37
【问题描述】:

我有一个使用 Docker 容器部署的 Rails 应用程序。我正在为数据库使用 PostgreSQL,并且我正在尝试设置 WAL-E 以对 S3 存储桶进行连续备份。为此设置需要对 postgresql.conf 文件进行一些更改。

我使用 postgres 官方镜像作为基础镜像,并传入一个 postgresql.conf 文件。这是我的 Dockerfile:

FROM postgres:9.4
MAINTAINER David Ham <me@example.com>

RUN apt-get update -y && apt-get install -y \
    git \
    python-virtualenv \
    python-dev \
    python-pip \
    libevent-dev \
    pv \
    lzop

RUN virtualenv /opt/wale \
    && . /opt/wale/bin/activate \
    && pip install git+https://github.com/wal-e/wal-e

COPY postgresql.conf /postgresql-wal-e/postgresql-wal-e.conf

RUN chown -R postgres:postgres /postgresql-wal-e

CMD ["postgres", "-c", "config-file=/postgresql-wal-e/postgresql-wal-e.conf"]

这是对的吗?它似乎已正确复制,但这是使用其官方图像配置 Postgres 的正确方法吗?

【问题讨论】:

标签: postgresql docker


【解决方案1】:

是的,您的配置方式应该可行。

你可以在这个问题的答案中找到其他方法 How to customize the configuration file of the official PostgreSQL Docker image?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-19
    • 2020-11-02
    • 1970-01-01
    • 1970-01-01
    • 2020-12-20
    • 1970-01-01
    相关资源
    最近更新 更多