1.docker 镜像查看
[root@iZ2ze70su5hanmrf3p0ovaZ /]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos02 v2 6a8b22d5dc8b 38 minutes ago 271MB
centos01 v1 a73b7cd23fd3 45 minutes ago 271MB
<none> <none> 1076f6658080 48 minutes ago 271MB
<none> <none> 40961536ce92 50 minutes ago 271MB
test dev f8c19629ce4a 5 hours ago 71.5MB
tianyaox/test2 v2 f8c19629ce4a 5 hours ago 71.5MB
centos latest 67fa590cfc1c 4 weeks ago 202MB
tianyaox/web v1 88403eb7d7e0 8 months ago 824MB
2.搜索想要拉取的镜像
[root@iZ2ze70su5hanmrf3p0ovaZ /]# docker search php
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
php While designed for web development, the PHP … 4736 [OK]
phpmyadmin/phpmyadmin A web interface for MySQL and MariaDB. 849 [OK]
php-zendserver Zend Server - the integrated PHP application… 169 [OK]
webdevops/php-nginx Nginx with PHP-FPM 138 [OK]
webdevops/php-apache-dev PHP with Apache for Development (eg. with xd… 112 [OK]
webdevops/php-apache Apache with PHP-FPM (based on webdevops/php) 95 [OK]
bitnami/php-fpm Bitnami PHP-FPM Docker Image 79 [OK]
phpunit/phpunit PHPUnit is a programmer-oriented testing fra… 74 [OK]
nazarpc/phpmyadmin phpMyAdmin as Docker container, based on off… 60 [OK]
circleci/php CircleCI images for PHP 25
centos/php-56-centos7 Platform for building and running PHP 5.6 ap… 22
adrianharabula/php7-with-oci8 Latest PHP 7.1 with apache and Oracle oci8 17 [OK]
3.拉取对应镜像
[root@iZ2ze70su5hanmrf3p0ovaZ /]# docker pull php
Using default tag: latest
latest: Pulling from library/php
b8f262c62ec6: Pull complete
a98660e7def6: Pull complete
4d75689ceb37: Pull complete
639eb0368afa: Pull complete
557de3a1500e: Pull complete
49192d4a832c: Pull complete
0b170c200535: Pull complete
16b188e0f46e: Pull complete
8ba696efa5f1: Pull complete
58f34a88010c: Pull complete
Digest: sha256:ea1c3a9091bd11c45e504905d6f329eb48f71c7cc358d8b4133d4079830487b9
Status: Downloaded newer image for php:latest
docker.io/library/php:latest
注意:1.若拉取hub docker仓库中指定账号中的镜像,命令为
[root@iZ2ze70su5hanmrf3p0ovaZ /]# docker pull tianyaox/test2:v2
v2: Pulling from tianyaox/test2
Digest: sha256:b401d7df042126b4325cb4de76501d11f327725dce00b283b6aa66adcb894f06
Status: Downloaded newer image for tianyaox/test2:v2
docker.io/tianyaox/test2:v2
2.若拉取其他仓库的镜像,命令为
[root@iZ2ze70su5hanmrf3p0ovaZ /]# docker pull hub.c.163.com/library/tomcat:latest