Docker Cloud repositories预计阅读时间: 5 分钟
Repositories in Docker Cloud store your Docker images. You can create
repositories and manually push images using
docker push, or
you can link to a source code provider and use automated builds to build the images for you. These repositories
can be either public or private.
Additionally, you can access your Docker Hub repositories and automated builds from within Docker Cloud.
Create a new repository in Docker Cloud
To store your images in Docker Cloud, you create a repository. All individual users can create one private repository for free, and can create unlimited public repositories.
- Click Repositories in the left navigation.
- Click Create.
- Enter a name and an optional description.
- Choose a visibility setting for the repository.
- Optionally, click a linked source code provider to set up automated builds.
- Select a namespace from that source code provider.
- From that namespace, select a repository to build.
- Optionally, expand the build settings section to set up build rules and enable or disable Autobuilds.
Note: You do not need to set up automated builds right away, and you can change the build settings at any time after the repository is created. If you choose not to enable automated builds, you can still push images to the repository using the
- Click Create.
Repositories for Organizations
Only members of an organization’s
Owners team can create new repositories for
the organization. Members of
Owners can also change the organization’s billing
information, and link the organization to a source code provider to set up
A member of the
Owners team must also set up the repository’s access
permissions so that other teams within the organization can use it. To learn
more, see the organizations and teams documentation.
Edit an existing repository in Docker Cloud
You can edit repositories in Docker Cloud to change the description and build configuration.
From the General page, you can edit the repository’s short description, or click to edit the version of the ReadMe displayed on the repository page.
Note: Edits to the Docker Cloud ReadMe are not reflected in the source code linked to a repository.
To run a build, or to set up or change automated build settings, click the Builds tab, and click Configure Automated Builds. See the documentation on configuring automated build settings for more information.
Change repository privacy settings
Repositories in Docker Cloud can be either public or private. Public repositories are visible from the Docker Store’s Community Content section, and can also be searched for from Docker Cloud’s Create Service wizard. Private repositories are only visible to the user account that created it (unless it belongs to an Organization, see below).
If a private repository belongs to an Organization, members of the
Owners team configure access. Only members of the
Owners team can change an
organization’s repository privacy settings.
Each Docker Cloud account comes with one free private repository. Additional private repositories are available for subscribers on paid plans.
To change a repository’s privacy settings:
- Navigate to the repository in Docker Cloud.
- Click the Settings tab.
- Click the Make public or Make private button.
- In the dialog that appears, enter the name of the repository to confirm the change.
- Click the button to save the change.
Delete a repository
When you delete a repository in Docker Cloud, all of the images in that repository are also deleted.
If automated builds are configured for the repository, the build rules and settings are deleted along with any Docker Security Scan results. However, this does not affect the code in the linked source code repository, and does not remove the source code provider link.
If you are running a service from deleted repository , the service will continue
to run, but cannot be scaled up or redeployed. If any builds use the Docker
FROM directive and reference a deleted repository, those builds will fail.
To delete a repository:
- Navigate to the repository, and click the Settings tab.
- Click Delete.
- Enter the name of the repository to confirm deletion, and click Delete.
External (third-party) repositories cannot be deleted from within Docker Cloud, however you can remove a link to them using the same process for a repository in Docker Cloud. The link is removed, but images in the external repository are not deleted.
Note: If the repository to be deleted or removed belongs to an Organization, only members of the
Ownersteam can delete it.
Link to a repository from a third party registry
You can link to repositories hosted on a third party registry. This allows you to deploy images from the third party registry to nodes in Docker Cloud, and also allows you to enable automated builds which push built images back to the registry.
Note: To link to a repository that you want to share with an organization, contact a member of the organization’s
Ownersteam. Only the Owners team can import new external registry repositories for an organization.
Click Repositories in the side menu.
Click the down arrow menu next to the Create button.
Enter the name of the repository that you want to add.
registry.comis the hostname of the registry.
Enter credentials for the registry.
Note: These credentials must have push permission in order to push built images back to the repository. If you provide read-only credentials, you will be able to run automated tests and deploy from the repository to your nodes, but you will not be able to push built images to it.
Confirm that the repository on the third-party registry now appears in your Repositories dropdown list.