Re: postgres and initdb not working inside docker

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: postgres and initdb not working inside docker
Дата
Msg-id CAKFQuwZ5wqhKtL1whU2e2h17isT6gLdZQVyBXmhoWNzW_OppQA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: postgres and initdb not working inside docker  (Roffild <roffild@hotmail.com>)
Список pgsql-hackers
On Sat, May 28, 2022 at 9:35 AM Roffild <roffild@hotmail.com> wrote:
Docker is now the DevOps standard. It's easier to build an image for
Docker and run the site with one command.

But the volume mount has a limitation with chmod 755. I don't want to
write the database directly to the container.

The container is isolated from everything. Therefore, checking the file
permissions inside the container is meaningless. And writing to the
container is also a "security hole".

The world has changed! And the old standards don't work...


Given the general lack of clamoring for this kind of change I'd be more inclined to believe that your specific attempt at doing this is problematic rather than there being a pervasive incompatibility between Docker and PostgreSQL.  There is a host environment, a container environment, multiple ways to expose host resources to the container, and the command line and/or docker file configuration itself.  None of which you've shared.  So I think that skepticism about your claims is quite understandable.

My suspicion is you aren't leveraging named volumes to separate the container and storage and that doing so will give you the desired separation and control of the directory permissions.

Based upon my reading of:


and limited personal experience using Docker, I'm inclined to believe it can be made to work even if you cannot do it exactly the way you are trying right now.  Absent a use case for why one way is preferable to another having the bar set at "it works if you do it like this" seems reasonable.

David J.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Roffild
Дата:
Сообщение: Re: postgres and initdb not working inside docker
Следующее
От: Feike Steenbergen
Дата:
Сообщение: Re: postgres and initdb not working inside docker