Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Lacking sensible instructions in the Docker Hub readme

未关闭
#1,071 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
文档
描述清晰度
需要澄清
活跃度
停滞
技术栈
docker, postgres, shell

调研方向

从 Docker Hub 的 README 和 issue 中引用的 docker-library/docs 仓库开始。检查提供的 init-db.sh 示例以及现有的 rootless Postgres 指南,包括已过时的 pull request 链接。完成应意味着已确定一致的范围,并有一份完整、未截断的指南,涵盖安全的用户设置和非特权运行。

由索引模型根据 Issue 内容生成。

描述

Hi,

The Docker Hub readme instructs users to treat a container with $POSTGRES_PASSWORD supplied as immediately usable, which can only be true if the user's intention was to grant their application superuser access to the database (and is only possible because the variable name belies its true function). Creating an unprivileged user is an afterthought relegated to below-the-fold, requires an init script be mounted, and the example doesn't even demonstrate setting up an auth mechanism for the new user. At the bare minimum I'd expect an environment-based facility to create an unprivileged user (I've included my own init script below for reference).

Additionally, the instructions on running the container itself unprivileged are also below the fold, and the most apparently useful of the options given is a link to a half-decade-old pull request which includes no documentation and has since been almost completely reworked in master. I still haven't figured out how to make rootless postgres work as yet.

Finally, the Hub readme (despite not informing users of how to run either the container or the database itself securely) is truncated for exceeding the 25,000 word limit on Docker Hub.

The postgres Docker image needn't provision the Fort Knox of configurations, but users ought to at least be reasonably informed, particularly about security implications, and given the information/tools to provision a container utilizing the bare minimum security good practice. Is there a process that can be kicked off for reconsidering some of these approaches please?

I'm happy to open this issue over at docker-library/docs if necessary, but since this involves issues with the image itself this seemed a more appropriate place.

Thank you.

init-db.sh

#!/bin/bash

set -euo pipefail

psql -v ON_ERROR_STOP=1 --username postgres --dbname postgres --set pass="$DB_PASSWORD" <<-EOF
    CREATE USER '$DB_USER' WITH ENCRYPTED PASSWORD :'pass';
    CREATE DATABASE '$DB_USER' WITH OWNER '$DB_USER' TEMPLATE template0 ENCODING UTF8 LC_COLLATE 'en_US.UTF-8' LC_CTYPE 'en_US.UTF-8';
EOF
主要语言
Shell
星标
2.5k
派生
1.2k
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

docker-library/postgres 的其他 Issue

查看 docker-library/postgres 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。