Docker Quick Start series (3): warehouse concepts and related operations
Docker Hub
First, we need to distinguish two concepts: warehouse and registration server.
In Docker, the repository stores images in a centralized manner, while the registration server stores images in the repository,
A registration server can store multiple warehouses, for example:
The address of the dl.doc kerpool.com # repository name is ubuntu.
What is Docker Hub? If you have used Github, Docker Hub and Github
Similarly, the former Stores Management images, and the latter Stores Management Code. Actually
The current method is the same.
You can useDocker loginCommand to register. After the registration is completed, the user's directory will have a .doc kercfg file, and your authentication information will be stored here
Here we will find a ubuntu Image
There are two forms of name: one is a word, for example, the first one. The following field information shows that this is an official standard image.
The second form is xxx/xxx. For example:
Ansible/ubuntu14.04-ansible # This indicates a ubuntu image created by the docker user ansible.
Programs that automatically update images in a container
You may encounter a problem, an application update problem, or a new feature of the opposite sex must be available in a new version.
The Automatic Updates here help us solve this problem. The automatic creation function of Docker allows users to track projects on a target website (currently only Github and BitBucket are supported) through Docker Hub, once a new version of these projects is submitted, Docker automatically creates them. What if I configure automatic creation?
The steps are as follows:
1: Create and log on to Docker hub and associate it with the target website.
2: Configure an automatic creation in Docker Hub
3: select a project and branch in the target website
4: specify the location of the Dockerfile and submit the creation.
Then, track the status of each creation on the "Automatic Creation" page in Docker Hub.
# Here we just talk about the process. I have a blog post on how to configure automatic creation of Docker.
Create and use a private Repository
After installing Docker, you can use the official registry image to build a local private repository environment:
Docker run-d-p 5000: 5000 registry # Here-p 5000: 5000 refers to ing the host machine port 5000 to the port 5000 of the registry image container.
After a registry container is automatically downloaded and started, a local private repository service is created. By default, the repository is created under the/tmp/registry directory of the container. You can use the-v parameter to store the image file in a specified local path.
docker run -d -p 5000:5000 -v /opt/data/registry:/tmp/registry registry
Management of private repository Images
docker images
Use the Docker tag command to mark image job1: latest as 127.0.0.1: 5000/test
docker tag job1:latest 127.0.0.1:5000/test
Next we will use Docker push to upload the marked image:
Docker push 127.0.0.1/test # We push the image to the test warehouse of the private server we configured. Of course, we simulate it on the local machine.