1. Docker image Image
the cornerstone of the vesselCascade read-only file systemFederated Loading (union Mount)2. Image storage Address/var/lib/docker3. Mirroring operationlist Mirrorsmirroring labels and warehousesView ImageRemove Mirror1) List Mirrors$docker images [optsions] [REPOSITORY]-A, --all=false Show all mirrors -F, --filter=[] filter conditions when displayed --no-trunc = False does not use truncated mode to display data -Q,--quiet = False only realistic Veid [email protected] ~]# Docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
CentOS latest Eeb3a076a0be hours ago 196.7 MB
Ubuntu latest ab035c88d533 2 weeks ago 187.9 MB
2) mirrored warehouses and labelsMirrorREPOSITORY Warehouse (contains a separate mirror) REGISTRY Warehouse labelTAGubuntu:14:04ubuntu:latest (latest is used by default if the image is not signed)3) View image$docker Inspect [OPTIONS] CONTAINER | IMAGE [CONTAINER | IMAGE ...]-F, --format = "" [email protected] ~]# Docker inspect CentOS4) Delete image$docker RMI [OPTIONS] image [Image ...]-F, --format = false Force removal of the image-no-prune = False Donot Delete untagged parents [[email protected] ~]# Docker RMI $ (Docker images-q Ubuntu) Delete all Ubuntu images Get and push imagesFind MirrorsPull MirrorPush Image1) Find imagemethod One: Docker Hubhttps://registry.hub.docker.commethod Two: $docker search [OPTIONS] term--automated = False only show automated builds --no-trunc = False Don ' t truncate output --s,-stars = 0 displays with at least X stars returns up to 25 results2) Pull Imagemethod One: $docker pull [OPTIONS] NAME [: TAG]-A,--all-tags=false Download all tagged images in the repositorymethod Two: Use the-registry-mirror option1. Modification:/etc/default/docker2, add: docker_opts = "--registry-mirror=http://mirror_addr"HTTPS://WWW.DAOCLOUD.IO3) Push image$docker Push NAME [: TAG]Docker push Dormancypress/nginxBuild image$docker commit to build a mirror from a container build $docker Build with dockerfile files 1) Use commit to build the image$docker commit [OPTIONS] CONTAINER [Repository[:tag]]-a,-author = "" Authore.g., "John Hannibal Smith [email protected]"-m,-message = "" Commit message -P, -pause = True pause container during commit Example:
[[email protected] ~]# Docker commit-a ' Tale '-M ' nginx ' commit_test dormancypress/commit_test1 construction Image
84daaea3c4fa276f777af22efaeadc65490124dc356c5219d5e7cf57554ad49a
[email protected] ~]# Docker run-d-P--name nginx_web1 dormancypress/commit_test1 nginx-g "daemon off;" creating a container with a constructed image
E887d27c3cd3ea342de3b21e4c233a14bfdb80675644e15de87967651c05c4e6
2) Use Dockerfile to build image 1, create Dockerfile example: #First dockerfile for test from Ubuntu maintainer dormancypress "[email protected]" Run Apt-get update run apt-get-y install Nginx EXPOSE 802, use the $docker build command $ docker build-t= "Dormanctpress/df_test".
Docker Mirrors and warehouses