( 13、 ... and ) Mirror summary
In this section, we first discuss the hierarchical structure of mirrors , Then I learned how to build a mirror image , Finally, practice using Docker Hub And local registry.
Mirror common command :
images Show a list of mirrors
history Show mirror build history
commit Create a new image from the container
build from Dockerfile Build a mirror image
tag Call the image tag
pull from registry Download mirroring
push take Mirror image Upload to registry
rmi Delete Docker host In the mirror
search Search for Docker Hub In the mirror
(1)rmi
rmi Delete only host Image on , Does not delete registry Mirror image . If one mirror corresponds to more than one tag, Only when the last one tag Is deleted , The mirror image is actually deleted . for example host in httpd There are two mirrors tag:
root@cuiyongchao:/dockerfile# docker images httpd
REPOSITORY TAG IMAGE ID CREATED SIZE
httpd latest 3dd970e6b110 2 weeks ago 138MB
httpd v1 3dd970e6b110 2 weeks ago 138MB
root@cuiyongchao:/dockerfile#
Delete debian:latest Just deleted latest tag, The image itself is not deleted .
root@cuiyongchao:/dockerfile# docker rmi httpd:latest
Untagged: httpd:latest
root@cuiyongchao:/dockerfile# docker images httpd
REPOSITORY TAG IMAGE ID CREATED SIZE
httpd v1 3dd970e6b110 2 weeks ago 138MB
root@cuiyongchao:/dockerfile#
Only when httpd: v1 Also when deleted , The entire image will be deleted .
root@cuiyongchao:/dockerfile# docker rmi httpd:v1
Untagged: httpd:v1
Untagged: httpd@sha256:b82fb56847fcbcca9f8f162a3232acb4a302af96b1b2af1c4c3ac45ef0c9b968
root@cuiyongchao:/dockerfile# docker images httpd
REPOSITORY TAG IMAGE ID CREATED SIZE
root@cuiyongchao:/dockerfile#
(2)search
search Let's not have to open the browser , On the command line, you can search for Docker Hub In the mirror .
root@cuiyongchao:/dockerfile# docker search httpd
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
httpd The Apache HTTP Server Project 3226 [OK]
centos/httpd-24-centos7 Platform for running Apache httpd 2.4 or bui… 36
centos/httpd 32 [OK]
arm32v7/httpd The Apache HTTP Server Project 9
arm64v8/httpd The Apache HTTP Server Project 5
polinux/httpd-php Apache with PHP in Docker (Supervisor, CentO… 4 [OK]
salim1983hoop/httpd24 Dockerfile running apache config 2 [OK]
lead4good/httpd-fpm httpd server which connects via fcgi proxy h… 1 [OK]
solsson/httpd-openidc mod_auth_openidc on official httpd image, ve… 1 [OK]
jonathanheilmann/httpd-alpine-rewrite httpd:alpine with enabled mod_rewrite 1 [OK]
publici/httpd httpd:latest 1 [OK]
dariko/httpd-rproxy-ldap Apache httpd reverse proxy with LDAP authent… 1 [OK]
clearlinux/httpd httpd HyperText Transfer Protocol (HTTP) ser… 1
appertly/httpd Customized Apache HTTPD that uses a PHP-FPM … 0 [OK]
interlutions/httpd httpd docker image with debian-based config … 0 [OK]
e2eteam/httpd 0
amd64/httpd The Apache HTTP Server Project 0
manasip/httpd 0
trollin/httpd 0
hypoport/httpd-cgi httpd-cgi 0 [OK]
manageiq/httpd_configmap_generator Httpd Configmap Generator 0 [OK]
itsziget/httpd24 Extended HTTPD Docker image based on the off… 0 [OK]
manageiq/httpd Container with httpd, built on CentOS for Ma… 0 [OK]
alvistack/httpd Docker Image Packaging for Apache 0 [OK]
dockerpinata/httpd 0
root@cuiyongchao:/dockerfile#