Feature request: Choose public or private visibility when pushing a new repository to Docker Hub
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with the related discussion in issue #4977 and review Docker Hub’s repository creation API, especially its is_private field. The payload names no CLI files or tests, so first locate the docker push command and its registry handling. Done means new Docker Hub repositories use the requested visibility before upload, mismatches and failures stop the push, and other registries are clearly handled.
索引モデルが issue の本文から書いたものです。
説明
Description
When running docker push for a Docker Hub repository that does not yet exist, Docker Hub creates it using the namespace's default repository visibility.
If that default is public, a user intending to upload a private image can accidentally publish it. The CLI does not offer a public/private selection before uploading.
I would like an option to explicitly select the intended visibility when pushing to a new Docker Hub repository.
Steps illustrating the current behavior
-
Use a Docker Hub namespace whose default repository visibility is Public.
-
Tag a local image with a repository name that does not exist:
docker tag myapp:latest <username>/new-repository:latest -
Push the image:
docker push <username>/new-repository:latest -
Check the newly created repository's visibility in Docker Hub.
The repository is created as public according to the namespace default, without a visibility selection in the CLI.
Proposed behavior
Allow users to explicitly select visibility before the first upload. For example, the following is proposed syntax, not an existing option:
docker push --visibility private <username>/new-repository:latest
docker push --visibility public <username>/new-repository:latest
An optional interactive mode could offer:
Choose visibility for the new Docker Hub repository:
> Private
Public
Automation should be able to use the explicit flag without any interactive prompt. Existing command behavior should remain unchanged when the feature is not requested.
Expected safeguards
- Create a missing repository with the requested visibility before uploading any image content.
- Verify the repository's visibility before pushing, and stop if verification or creation fails, including permission or private-repository quota errors.
- For an existing repository, report a visibility mismatch rather than silently changing its visibility.
- Clearly report unsupported registries if this functionality is specific to Docker Hub.
Implementation consideration
Repository visibility is managed by Docker Hub rather than the standard image-push protocol. This may require Docker Hub API integration or a dedicated CLI plugin. A check before uploading also cannot prevent another authorized actor from changing repository visibility concurrently or afterward.
References and related discussion
- Docker Hub default privacy settings: https://docs.docker.com/docker-hub/settings/
- Docker Hub repository creation API, including
is_private: https://docs.docker.com/reference/api/hub/latest/operations/CreateRepository/ - Related feature request: https://github.com/docker/cli/issues/4977
This request overlaps with #4977; I am linking it to preserve the existing discussion and implementation constraints.
- 主要言語
- Go
- スター
- 6.1k
- フォーク
- 2.2k
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 62
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
docker/cli のほかの issue
-
Mode option in tmpfs volume is ignored when deployed via docker stack deploy対応中かも @locker95 が 15 日前に担当しました。 オープンkind/bug status/0-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
docker stack: text after an unbraced `$VAR` is dropped when it starts with `-`, `:-`, `?` or `:?`対応中かも @sebxt が 28 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
メンテナーはふだん 1 日以内に返信
-
filename completion on `docker load -i`対応中かも @cra が 31 日前に担当しました。 オープンkind/feature status/0-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
docker build treats uppercase HTTP(S) URLs as local paths対応中かも @TanvirTian が 38 日前に担当しました。 オープンkind/bug status/0-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
`docker context export` writes a truncated tar archive対応中かも @2arian3 が 54 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
agent-review-finding chore
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
jordansmall/spindrift#7254 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pg-sharding/spqr#3275 ·
メンテナーはふだん 1 日以内に返信
-
create_or_update_file rejects explicitly empty file content対応中かも @Elon-Jiang が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
github/github-mcp-server#3883 ·
メンテナーはふだん 4 日以内に返信
-
feature
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
databricks/terraform-provider-databricks#6210 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
IBM-Cloud/terraform-provider-ibm#7115 ·
メンテナーはふだん 2 日以内に返信