简体   繁体   English

如何从Postgres docker镜像更改postgresql.conf

[英]How to change postgresql.conf from Postgres docker image

I have a Rails app that I'm deploying using Docker containers. 我有一个Rails应用程序,我正在使用Docker容器进行部署。 I'm using PostgreSQL for the database, and I'm trying to set up WAL-E to do continuous backups to an S3 bucket. 我正在使用PostgreSQL作为数据库,我正在尝试设置WAL-E来连续备份到S3存储桶。 The setup for this involves making a few changes to the postgresql.conf file. 此设置涉及对postgresql.conf文件进行一些更改。

I am using a postgres official image as a base image, and am passing in a postgresql.conf file. 我使用postgres官方图像作为基本图像,并传入postgresql.conf文件。 Here is my Dockerfile: 这是我的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"]

Is this right? 这是正确的吗? It seems to have copied in correctly, but is this the right way to configure Postgres with their official images? 它似乎已正确复制,但这是用他们的官方图像配置Postgres的正确方法吗?

yes, your way to configure should work. 是的,您的配置方式应该有效。

you can find other ways in answers of this question How to customize the configuration file of the official PostgreSQL Docker image? 你可以在这个问题的答案中找到其他方法如何自定义官方PostgreSQL Docker镜像的配置文件?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何绕过 postgresql.conf - how to bypass postgresql.conf Ubuntu 上的 Postgres,控制 postgresql.conf 位置 - Postgres on Ubuntu, controlling the postgresql.conf location 如何在Google Cloud SQL上更改postgresql.conf参数 - How to change the postgresql.conf parameter on Google Cloud SQL 在 docker 容器中替换 postgresql.conf - Replacing postgresql.conf in a docker container 如何在 Azure PostgreSQL 上编辑 postgresql.conf? - How to Edit postgresql.conf on Azure PostgreSQL? Postgres Docker:“postgres:无法访问服务器配置文件”/var/lib/postgresql/data/postgresql.conf“:没有这样的文件或目录” - Postgres Docker: “postgres: could not access the server configuration file ”/var/lib/postgresql/data/postgresql.conf“: No such file or directory” Postgresql.conf变量 - Postgresql.conf variables Postgres完全忽略在postgresql.conf文件中设置的配置 - Postgres Completely Ignores Configurations set in postgresql.conf file 使用org.testcontainers时,如何在docker容器中包含postgresql.conf - How do you include postgresql.conf on docker container when using org.testcontainers Dockerized Postgresql无法访问自定义映像上的postgresql.conf - Dockerized Postgresql cannot access postgresql.conf on custom image
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM