Get the basics of mirroring in the Docker tutorial
- 2020-05-30 21:42:44
Access to the mirror
In the previous introduction, we learned that mirroring is one of the three components of Docker.
Docker needs to have an image locally before running the container, and if the image does not exist locally, Docker will download it from the mirror repository (the default is the repository in the Docker Hub public registry server).
This chapter covers more about mirroring, including:Get the image from the warehouse; Manage images on localhost; Introduces the fundamentals of mirror implementation.
You can use the docker pull command to get the desired image from the warehouse.
The following example will download an image of the Ubuntu 12.04 operating system from the Docker Hub repository.
$ sudo docker pull ubuntu:12.04 Pulling repository ubuntu ab8e2728644c: Pulling dependent layers 511136ea3c5a: Download complete 5f0ffaa9455e: Download complete a300658979be: Download complete 904483ae0c30: Download complete ffdaafd1ca50: Download complete d047ae21eeaf: Download complete
During the download process, each layer of information of the captured image is output.
. The command is actually equivalent to $sudo docker pull registry hub. docker. com/ubuntu: 12.04 order, namely from registered server registry. hub. docker. com ubuntu warehouse to download mark of 12.04 in the mirror.
Sometimes the official warehouse registry server is slow to download and can be downloaded from other warehouses. You need to specify the full warehouse registration server address when downloading from another warehouse. For example,
$ sudo docker pull dl.dockerpool.com:5000/ubuntu:12.04 Pulling dl.dockerpool.com:5000/ubuntu ab8e2728644c: Pulling dependent layers 511136ea3c5a: Download complete 5f0ffaa9455e: Download complete a300658979be: Download complete 904483ae0c30: Download complete ffdaafd1ca50: Download complete d047ae21eeaf: Download complete
Once you're done, you're ready to use the image, for example, to create a container where you can run the bash application.
$ sudo docker run -t -i ubuntu:12.04 /bin/bash root@fe7fc4bd8fc9:/#
Thank you for reading, I hope to help you, thank you for your support of this site!