Feature request: Choose public or private visibility when pushing a new repository to Docker Hub
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 6.1k
- Fork
- 2.2k
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 62
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của docker/cli
-
Mode option in tmpfs volume is ignored when deployed via docker stack deployCó thể đã có người làm @locker95 đã nhận 15 ngày trước. Đang mởkind/bug status/0-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
docker stack: text after an unbraced `$VAR` is dropped when it starts with `-`, `:-`, `?` or `:?`Có thể đã có người làm @sebxt đã nhận 28 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 87/100
Maintainer thường phản hồi trong vòng 1 ngày
-
filename completion on `docker load -i`Có thể đã có người làm @cra đã nhận 31 ngày trước. Đang mởkind/feature status/0-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
docker build treats uppercase HTTP(S) URLs as local pathsCó thể đã có người làm @TanvirTian đã nhận 38 ngày trước. Đang mởkind/bug status/0-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
`docker context export` writes a truncated tar archiveCó thể đã có người làm @2arian3 đã nhận 54 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
agent-review-finding chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
jordansmall/spindrift#7254 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
pg-sharding/spqr#3275 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
create_or_update_file rejects explicitly empty file contentCó thể đã có người làm @Elon-Jiang đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
github/github-mcp-server#3883 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
databricks/terraform-provider-databricks#6210 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
IBM-Cloud/terraform-provider-ibm#7115 ·
Maintainer thường phản hồi trong vòng 2 ngày