[Self-study Docker] Docker pull command

outline

insert image description here

Docker pull command

docker pull command tutorial

The docker pull command is used to pull or update a specified image from a mirror repository. The name in the docker pull command, that is, the image name, can be followed by the image label or image summary.

If the docker pull command does not specify an image tag, docker uses the :latest tag by default.

docker pull command syntax

[root@localhost ~]# docker pull [OPTIONS] NAME[:TAG|@DIGEST]

docker pull command parameters

parameter describe
docker pull -a Pull all tagged images.
docker pull --disable-content-trust Ignore the verification of the image, which is enabled by default.

the case

Pull the latest version of the mirror

We use the docker pull command to pull the latest version of the nginx image.

[root@localhost ~]# docker pull nginx

Because we did not specify a tag, the latest image is pulled here by default. After the pull is completed, the terminal displays the following image:

insert image description here

Now we use the docker images command to view the nginx image just pulled, and the terminal display is as follows:

insert image description here

Use the docker rmi command to remove all images.

[root@localhost ~]# docker rmi `docker images -q`

Pull the specified TAG image

We use the docker pull command to pull the ubuntu image of the specified TAG.

[root@localhost ~]# docker pull ubuntu:14.04

After the pull is complete, the terminal will display as shown in the following figure:
insert image description here

Because we have specified the version information of docker images here, the latest version will not be pulled, but the version we specified will be pulled.

Now we use the docker images command to view the ubuntu image just pulled, and the terminal display is as follows:

insert image description here

Use the docker rmi command to remove all images.

[root@localhost ~]# docker rmi `docker images -q`

Pull all mirrors

The docker pull command will only pull one image by default. We can use the -a parameter to specify to pull all images.

[root@localhost ~]# docker pull ubuntu -a

After the pull is complete, the terminal will display as shown in the following figure:

insert image description here

Now we use the docker images command to view the ubuntu image just pulled, and the terminal display is as follows:

insert image description here

We can see that all the images of ubuntu versions are pulled here, not just one.

Use the docker rmi command to remove all images.

[root@localhost ~]# docker rmi `docker images -q`

Summary of docker pull command

The docker pull command is used to pull or update a specified image from a mirror repository.

If the docker pull command does not specify an image tag, docker uses the :latest tag by default.

The docker pull command will only pull one image by default. We can use the -a parameter to specify to pull all images.

docker pull command syntax:

docker pull [OPTIONS] NAME[:TAG|@DIGEST]

Guess you like

Origin blog.csdn.net/weixin_41384860/article/details/128912237