3

When searching the image php:7.3.15-apache in openshift and we found it, but the same image is not found when searching using the docker search command.

Why it is like that ? Why docker pull can find the image but docker search can't find the image.

Example

enter image description here

testuser@docker:~$ sudo docker search php:7.3.15-apache
NAME                DESCRIPTION         STARS               OFFICIAL            AUTOMATED
testuser@docker:~$ 

When using docker pull, it is downloadable :

testuser@docker:~$ sudo docker pull php:7.3.15-apache
7.3.15-apache: Pulling from library/php
68ced04f60ab: Downloading [=========>                                         ]  5.008MB/27.09MB
68ced04f60ab: Pull complete 
1d2a5d8fa585: Pull complete 
5d59ec4ae241: Pull complete 
d42331ef4d44: Pull complete 
408b7b7ee112: Pull complete 
570cd47896d5: Pull complete 
2419413b2a16: Pull complete 
8c722e1dceb9: Pull complete 
34fb68439fc4: Pull complete 
e775bf0f756d: Pull complete 
b1949a1e9661: Pull complete 
6ed8bcec42ae: Pull complete 
f6247da7d55f: Pull complete 
a090bafe99ea: Pull complete 
Digest: sha256:ad53b6b5737c389d1bcea8acc2225985d5d90e6eb362911547e163f1924ec089
Status: Downloaded newer image for php:7.3.15-apache
docker.io/library/php:7.3.15-apache
Software Engineer
  • 15,457
  • 7
  • 74
  • 102
Gopu
  • 1,022
  • 2
  • 11
  • 20

3 Answers3

5

As far as I understand docker hub have only those versions of php .

sudo docker search php

NAME                       DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
php                        While designed for web development, the PHP …   5114                [OK]                
phpmyadmin/phpmyadmin      A web interface for MySQL and MariaDB.          967                                     [OK]
adminer                    Database management in a single PHP file.       362                 [OK]                
php-zendserver             Zend Server - the integrated PHP application…   180                 [OK]                
webdevops/php-nginx        Nginx with PHP-FPM                              150                                     [OK]
webdevops/php-apache-dev   PHP with Apache for Development (eg. with xd…   116                                     [OK]
webdevops/php-apache       Apache with PHP-FPM (based on webdevops/php)    100                                     [OK]
bitnami/php-fpm            Bitnami PHP-FPM Docker Image                    86                                      [OK]
phpunit/phpunit            PHPUnit is a programmer-oriented testing fra…   75                                      [OK]
nazarpc/phpmyadmin         phpMyAdmin as Docker container, based on off…   60                                      [OK]
circleci/php               CircleCI images for PHP                         28                                      
thecodingmachine/php       General-purpose ultra-configurable PHP images   28                                      [OK]
phpdockerio/php72-fpm      PHP 7.2 FPM base container for PHPDocker.io.    19                                      [OK]
bitnami/phpmyadmin         Bitnami Docker Image for phpMyAdmin             18                                      [OK]
phpdockerio/php7-fpm       PHP 7 FPM base container for PHPDocker.io.      14                                      [OK]
phpdockerio/php56-fpm      PHP 5.6 FPM base container for PHPDocker.io     13                                      [OK]
graze/php-alpine           Smallish php7 alpine image with some common …   13                                      [OK]
appsvc/php                 Azure App Service php dockerfiles               12                                      [OK]
phpdockerio/php73-fpm      PHP 7.3 FPM base container for PHPDocker.io.    11                                      
phpdockerio/php71-fpm      PHP 7.1 FPM base container for PHPDocker.io.    7                                       [OK]
phpdockerio/php72-cli      PHP 7.2 CLI base container for PHPDocker.io.    4                                       [OK]
phpdockerio/php7-cli       PHP 7 CLI base container image for PHPDocker…   1                                       [OK]
phpdockerio/php56-cli      PHP 5.6 CLI base container for PHPDocker.io …   1                                       [OK]
phpdockerio/php71-cli      PHP 7.1 CLI base container for PHPDocker.io.    1                                       [OK]
isotopab/php               Docker PHP                                      0                                       [OK]

So you could either use 1 of that.


OR, if you want this specific version


There is the specific image version on docker hub.


You can use docker pull

docker pull php:7.3.15-apache

And push it to your private registry with docker push

docker push

More about it.


And use your own registry instead of docker hub.

To deploy an image from a private repository, you must create an image pull secret with your image registry credentials. You have more informations under your Image Name.


I hope this answer your question. Let me know if you have any more questions.

Jakub
  • 8,189
  • 1
  • 17
  • 31
  • 1
    Dear @jt97 Thank you so much for your time. I was wondering the docker pull can find the exact image I need but why the docker search can't find it. What is the best method to search these images ? If I search in docker hub GUI also, It says nothing found. https://hub.docker.com/search?q=php%3A7.3.15-apache&type=image – Gopu Mar 19 '20 at 09:27
  • Hi @Gopu, I assume docker search might have only the prime versions, like 7.1,7.2 etc. About looking for specific images, I used search in docker hub GUI, just went through [php tags](https://hub.docker.com/_/php?tab=tags) and found the specific version on second page. – Jakub Mar 19 '20 at 10:02
2

@jt97 Thanks for directing me to the correct direction.I am adding more details with screenshots in this answer for newbies like me on how to search in dockerhub.

  1. Go to docker hub and search php enter image description here
  2. Select the first result. Select 'Tags' tab and enter the version name in the 'Filter Tags'. I have given 7.3.15-apache. No need to mention php again here. enter image description here

I don't know why docker search can't find this image. May be as @jt97 mentioned, it display only major versions.

Gopu
  • 1,022
  • 2
  • 11
  • 20
0

From an answer in How to search images from private 1.0 registry in docker?

You can specify the repository as part of the search.

I'm on RHEL 7.7 and if I do a "docker search centos8", it comes back with nothing but "docker search docker.io/centos8" works fine.

It looks like "docker pull" goes for docker hub by default, so the result is consistent for all docker users. [https://github.com/moby/moby/issues/7203]

The search command is less consistent (and doesn't have the same strict requirement for the level of consistency as 'pull'). If the docker daemon is running with multiple " --add-registry" options, the search doesn't appear to use them all.

Gary Myers
  • 34,963
  • 3
  • 49
  • 74