How to Upload Docker Image So That Other People Can Use
Repositories
Estimated reading time: half dozen minutes
Docker Hub repositories permit you lot share container images with your squad, customers, or the Docker community at large.
Docker images are pushed to Docker Hub through the docker push
command. A unmarried Docker Hub repository tin can agree many Docker images (stored equally tags).
Creating repositories
To create a repository, sign into Docker Hub, click on Repositories then Create Repository:
When creating a new repository:
- You can cull to put it in your Docker ID namespace, or in any organization where you are an owner.
-
The repository proper name needs to exist unique in that namespace, can be two to 255 characters, and tin just contain lowercase letters, numbers, hyphens (
-
), and underscores (_
).Annotation:
You cannot rename a Docker Hub repository once it has been created.
- The description can exist up to 100 characters and is used in the search result.
- You tin link a GitHub or Bitbucket account now, or choose to practice it later in the repository settings.
Afterwards y'all striking the Create push button, you tin can start using docker push
to push images to this repository.
Deleting a repository
-
Sign into Docker Hub and click Repositories.
-
Select a repository from the listing, click Settings and then Delete Repository.
Notation:
Deleting a repository deletes all the images information technology contains and its build settings. This activeness cannot be undone.
- Enter the name of the repository to confirm the deletion and click Delete.
Pushing a Docker container epitome to Docker Hub
To push an image to Docker Hub, y'all must first proper noun your local epitome using your Docker Hub username and the repository name that you created through Docker Hub on the web.
You tin can add multiple images to a repository by adding a specific :<tag>
to them (for case docs/base:testing
). If it's not specified, the tag defaults to latest
.
Name your local images using ane of these methods:
- When you lot build them, using
docker build -t <hub-user>/<repo-name>[:<tag>]
- Past re-tagging an existing local image
docker tag <existing-paradigm> <hub-user>/<repo-proper name>[:<tag>]
- By using
docker commit <existing-container> <hub-user>/<repo-name>[:<tag>]
to commit changes
At present you lot can push button this repository to the registry designated by its name or tag.
$ docker push button <hub-user>/<repo-proper noun>:<tag>
The image is then uploaded and available for use past your teammates and/or the community.
Individual repositories
Individual repositories let yous go on container images private, either to your own business relationship or within an organization or squad.
To create a individual repository, select Private when creating a repository:
You can also make an existing repository individual by going to its Settings tab:
You go one private repository for free with your Docker Hub user account (non usable for organizations you're a fellow member of). If you demand more private repositories for your user account, upgrade your Docker Hub programme from your Billing Information folio.
In one case the private repository is created, you can push
and pull
images to and from it using Docker.
Note: You lot demand to be signed in and have access to work with a individual repository.
Notation: Individual repositories are not currently available to search through the pinnacle-level search or
docker search
.
You can designate collaborators and manage their access to a private repository from that repository's Settings page. You can also toggle the repository'south condition between public and individual, if you have an bachelor repository slot open up. Otherwise, you tin can upgrade your Docker Hub programme.
Collaborators and their role
A collaborator is someone you want to give access to a private repository. Once designated, they can push
and pull
to your repositories. They are not immune to perform whatever administrative tasks such as deleting the repository or changing its status from individual to public.
Note
A collaborator cannot add other collaborators. Only the possessor of the repository has administrative access.
You can as well assign more granular collaborator rights ("Read", "Write", or "Admin") on Docker Hub by using organizations and teams. For more information come across the organizations documentation.
Docker Hub'due south individual repositories view shows you the available tags and the size of the associated image. Go to the Repositories view and click on a repository to see its tags.
Paradigm sizes are the cumulative space taken up by the prototype and all its parent images. This is also the disk space used by the contents of the .tar
file created when you docker relieve
an epitome.
To view individual tags, click on the Tags tab.
An image is considered stale if there has been no push/pull activity for more than than 1 month, i.e.:
- It has not been pulled for more than one month
- And it has non been pushed for more than than 1 month
A multi-compages image is considered stale if all single-architecture images part of its manifest are stale.
To delete a tag, select the respective checkbox and select Delete from the Action driblet-downward list.
Note
Merely a user with authoritative admission (owner or squad member with Admin permission) over the repository tin delete tags.
Select a tag's assimilate to view details.
Searching for Repositories
You tin can search the Docker Hub registry through its search interface or past using the command line interface. Searching tin find images by epitome proper noun, username, or description:
$ docker search centos Proper noun DESCRIPTION STARS OFFICIAL Automatic centos The official build of CentOS. 1034 [OK] ansible/centos7-ansible Ansible on Centos7 43 [OK] tutum/centos Centos image with SSH admission. For the root... xiii [OK] ...
At that place you can run across two example results: centos
and ansible/centos7-ansible
. The second outcome shows that it comes from the public repository of a user, named ansible/
, while the first upshot, centos
, doesn't explicitly list a repository which means that it comes from the peak-level namespace for Docker Official Images. The /
character separates a user's repository from the prototype proper noun.
Once you've institute the epitome you want, yous can download it with docker pull <imagename>
:
$ docker pull centos latest: Pulling from centos 6941bfcbbfca: Pull complete 41459f052977: Pull complete fd44297e2ddb: Already exists centos:latest: The image y'all are pulling has been verified. Of import: image verification is a tech preview feature and should not be relied on to provide security. Digest: sha256:d601d3b928eb2954653c59e65862aabb31edefa868bd5148a41fa45004c12288 Status: Downloaded newer image for centos:latest
You now take an paradigm from which you can run containers.
Starring Repositories
Your repositories can exist starred and you tin can star repositories in return. Stars are a manner to testify that yous like a repository. They are also an like shooting fish in a barrel way of bookmarking your favorites.
Docker, docker, trusted, registry, accounts, plans, Dockerfile, Docker Hub, webhooks, docs, documentationSource: https://docs.docker.com/docker-hub/repos/
0 Response to "How to Upload Docker Image So That Other People Can Use"
Post a Comment