Options: -a, --all Show all images (default hides intermediate images) # 列出本地所有的镜像(含中间映像层,默认情况下,过滤掉中间映像层) --digests Show digests # 显示镜像的摘要信息 -f, --filterfilterFilter output based on conditions provided # 显示满足条件的镜像 --format string Format output using a custom template: # 指定返回值的模板文件 'table': Print output in table format with column headers (default) 'table TEMPLATE': Print output in table format using the given Go template 'json': Print in JSON format 'TEMPLATE': Print output using the given Go template. Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates --no-trunc Don't truncate output # 显示完整的镜像信息 -q, --quiet Only show image IDs # 只显示镜像ID
Options: -f, --filter filter Filter output based on conditions provided # 列出收藏数不小于指定值的镜像 --format string Pretty-print search using a Go template --limit int Max number of search results # 最大搜索结果数 --no-trunc Don't truncate output # 显示完整的镜像描述
参数说明:
NAME: 镜像仓库源的名称
DESCRIPTION: 镜像的描述
OFFICIAL: 是否 docker 官方发布
stars: 类似 Github 里面的 star,表示点赞、喜欢的意思
AUTOMATED: 自动构建
从Docker Hub查找tomcat镜像
docker search tomcat
从 Docker Hub 查找所有镜像名包含 java,并且收藏数大于 10 的镜像
docker search -f stars=10 java
docker pull
[root@quan ~]# docker pull --help
Usage: docker pull [OPTIONS] NAME[:TAG|@DIGEST]
Download an image from a registry #从镜像仓库中拉取或者更新指定镜像
Aliases: docker image pull, docker pull
Options: -a, --all-tags Download all tagged images in the repository # 拉取所有 tagged 镜像 --disable-content-trust Skip image verification (default true) # 忽略镜像的校验,默认开启 --platform string Set platform if server is multi-platform capable -q, --quiet Suppress verbose output
Options: -f, --force Force removal of the image # 强制删除 --no-prune Do not delete untagged parents # 不移除该镜像的过程镜像,默认移除
强制删除tomcat镜像,不指定TAG,默认删除latest版本
docker rmi -f hello-world
强制删除多个镜像,删除tomcat:latest和mysql:5.7版本
docker rmi -f tomcat mysql:5.7
强制删除全部镜像
docker rmi -f $(docker images -qa)
容器命令
docker run
[root@VM-16-9-centos ~]# docker run --help
Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
Create and run a new container from an image # 创建一个新的容器并运行一个命令
Aliases: docker container run, docker run
Options: --add-host list Add a custom host-to-IP mapping (host:ip) -a, --attach list Attach to STDIN, STDOUT or STDERR --blkio-weight uint16 Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0) --blkio-weight-device list Block IO weight (relative device weight) (default []) --cap-add list Add Linux capabilities --cap-drop list Drop Linux capabilities --cgroup-parent string Optional parent cgroup for the container --cgroupns string Cgroup namespace to use (host|private) 'host': Run the container in the Docker host's cgroup namespace 'private': Run the container in its own private cgroup namespace '': Use the cgroup namespace as configured by the default-cgroupns-mode option on the daemon (default) --cidfile string Write the container ID to the file --cpu-period int Limit CPU CFS (Completely Fair Scheduler) period --cpu-quota int Limit CPU CFS (Completely Fair Scheduler) quota --cpu-rt-period int Limit CPU real-time period in microseconds --cpu-rt-runtime int Limit CPU real-time runtime in microseconds -c, --cpu-shares int CPU shares (relative weight) --cpus decimal Number of CPUs --cpuset-cpus string CPUs in which to allow execution (0-3, 0,1) # 绑定容器到指定CPU运行 --cpuset-mems string MEMs in which to allow execution (0-3, 0,1) -d, --detach Run container in background and print container ID #后台运行容器,并返回容器ID --detach-keys string Override the key sequence for detaching a container --device list Add a host device to the container --device-cgroup-rule list Add a rule to the cgroup allowed devices list --device-read-bps list Limit read rate (bytes per second) from a device (default []) --device-read-iops list Limit read rate (IO per second) from a device (default []) --device-write-bps list Limit write rate (bytes per second) to a device (default []) --device-write-iops list Limit write rate (IO per second) to a device (default []) --disable-content-trust Skip image verification (default true) --dns list Set custom DNS servers # 指定容器使用的DNS服务器,默认和宿主一致 --dns-option list Set DNS options --dns-search list Set custom DNS search domains # 指定容器DNS搜索域名,默认和宿主一致 --domainname string Container NIS domain name --entrypoint string Overwrite the default ENTRYPOINT of the image -e, --env list Set environment variables # 设置环境变量 --env-file list Read in a file of environment variables # 从指定文件读入环境变量 --expose list Expose a port or a range of ports # 开放一个端口或一组端口 --gpus gpu-request GPU devices to add to the container ('all' to pass all GPUs) --group-add list Add additional groups to join --health-cmd string Command to run to check health --health-interval duration Time between running the check (ms|s|m|h) (default 0s) --health-retries int Consecutive failures needed to report unhealthy --health-start-period duration Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s) --health-timeout duration Maximum time to allow one check to run (ms|s|m|h) (default 0s) --help Print usage -h, --hostname string Container host name # -h "mars": 指定容器的hostname; --init Run an init inside the container that forwards signals and reaps processes -i, --interactive Keep STDIN open even if not attached # 以交互模式运行容器,通常与 -t 同时使用; --ip string IPv4 address (e.g., 172.30.100.104) --ip6 string IPv6 address (e.g., 2001:db8::33) --ipc string IPC mode to use --isolation string Container isolation technology --kernel-memory bytes Kernel memory limit -l, --label list Set meta data on a container --label-file list Read in a line delimited file of labels --link list Add link to another container # 添加链接到另一个容器 --link-local-ip list Container IPv4/IPv6 link-local addresses --log-driver string Logging driver for the container --log-opt list Log driver options --mac-address string Container MAC address (e.g., 92:d0:c6:0a:29:33) -m, --memory bytes Memory limit # 设置容器使用内存最大值 --memory-reservation bytes Memory soft limit --memory-swap bytes Swap limit equal to memory plus swap: '-1' to enable unlimited swap --memory-swappiness int Tune container memory swappiness (0 to 100) (default -1) --mount mount Attach a filesystem mount to the container --name string Assign a name to the container # 为容器指定一个名称 --network network Connect a container to a network --network-alias list Add network-scoped alias for the container --no-healthcheck Disable any container-specified HEALTHCHECK --oom-kill-disable Disable OOM Killer --oom-score-adj int Tune host's OOM preferences (-1000 to 1000) --pid string PID namespace to use --pids-limit int Tune container pids limit (set -1 for unlimited) --platform string Set platform if server is multi-platform capable --privileged Give extended privileges to this container -p, --publish list Publish a container's port(s) to the host # 指定端口映射,格式为:主机(宿主)端口:容器端口(小P) -P, --publish-all Publish all exposed ports to random ports # 随机端口映射,容器内部端口随机映射到主机的端口(大P) --pull string Pull image before running ("always", "missing", "never") (default "missing") -q, --quiet Suppress the pull output --read-only Mount the container's root filesystem as read only --restart string Restart policy to apply when a container exits (default "no") --rm Automatically remove the container when it exits --runtime string Runtime to use for this container --security-opt list Security Options --shm-size bytes Size of /dev/shm --sig-proxy Proxy received signals to the process (default true) --stop-signal string Signal to stop the container --stop-timeout int Timeout (in seconds) to stop a container --storage-opt list Storage driver options for the container --sysctl map Sysctl options (default map[]) --tmpfs list Mount a tmpfs directory -t, --tty Allocate a pseudo-TTY # 为容器重新分配一个伪输入终端,通常与 -i 同时使用 --ulimit ulimit Ulimit options (default []) -u, --user string Username or UID (format: <name|uid>[:<group|gid>]) --userns string User namespace to use --uts string UTS namespace to use -v, --volume list Bind mount a volume # 绑定一个卷 --volume-driver string Optional volume driver for the container --volumes-from list Mount volumes from the specified container(s) -w, --workdir string Working directory inside the container
Options: -a, --all Show all containers (default shows just running) # 显示所有的容器,包括未运行的。 -f, --filter filter Filter output based on conditions provided # 根据条件过滤显示的内容。 --format string Format output using a custom template: # 指定返回值的模板文件。 'table': Print output in table format with column headers (default) 'table TEMPLATE': Print output in table format using the given Go template 'json': Print in JSON format 'TEMPLATE': Print output using the given Go template. Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates -n, --last int Show n last created containers (includes all states) (default -1) # 列出最近创建的n个容器。 -l, --latest Show the latest created container (includes all states) # 显示最近创建的容器 --no-trunc Don't truncate output # 不截断输出。 -q, --quiet Only display container IDs # 静默模式,只显示容器编号。 -s, --size Display total file sizes # 显示总的文件大小。
Options: -f, --force Force the removal of a running container (uses SIGKILL) # 强制移走正在运行的容器(使用SIGKILL) -l, --link Remove the specified link # 删除指定的链接 -v, --volumes Remove anonymous volumes associated with the container # 删除与容器关联的卷
删除nginx容器(容器ID为7234c5d014bf)
docker rm 7234c5d014bf
删除所有容器
docker rm -f $(docker ps -aq)
docker logs
[root@VM-16-9-centos ~]# docker logs --help
Usage: docker logs [OPTIONS] CONTAINER
Fetch the logs of a container # 获取容器的日志
Aliases: docker container logs, docker logs
Options: --details Show extra details provided to logs -f, --follow Follow log output # 跟踪日志输出 --since string Show logs since timestamp (e.g. "2013-01-02T13:23:37Z") or relative (e.g. "42m" for 42 minutes) #显示某个开始时间的所有日志 -n, --tail string Number of lines to show from the end of the logs (default "all") # 仅列出最新N条容器日志 -t, --timestamps Show timestamps # 显示时间戳 --until string Show logs before a timestamp (e.g. "2013-01-02T13:23:37Z") or relative (e.g. "42m" for 42 minutes)
Return low-level information on Docker objects # 获取容器/镜像的元数据。
Options: -f, --format string Format output using a custom template: # 指定返回值的模板文件。 'json': Print in JSON format 'TEMPLATE': Print output using the given Go template. Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates -s, --size Display total file sizes if the type is container # 显示总的文件大小。 --type string Return JSON for specified type# 为指定类型返回JSON
Execute a commandin a running container # 在运行的容器中执行命令
Aliases: docker container exec, docker exec
Options: -d, --detach Detached mode: run commandin the background # 分离模式: 在后台运行 --detach-keys string Override the key sequence for detaching a container -e, --env list Set environment variables --env-file list Read in a file of environment variables -i, --interactive Keep STDIN open even if not attached # 即使没有附加也保持STDIN 打开 --privileged Give extended privileges to the command -t, --tty Allocate a pseudo-TTY # 分配一个伪终端 -u, --user string Username or UID (format: "<name|uid>[:<group|gid>]") -w, --workdir string Working directory inside the container
通过 docker ps -a 命令查看已经在运行的容器,然后使用容器 ID (9df70f9a0714)进入容器。通过 exec 命令对指定的容器执行 bash。
exec是在容器中打开新的终端,并且可以启动新的进程
docker exec -it 9df70f9a0714 /bin/bash
docker attach
[root@VM-16-9-centos ~]# docker attach --help
Usage: docker attach [OPTIONS] CONTAINER
Attach local standard input, output, and error streams to a running container # 连接到正在运行中的容器。
Aliases: docker container attach, docker attach
Options: --detach-keys string Override the key sequence for detaching a container --no-stdin Do not attach STDIN --sig-proxy Proxy all received signals to the process (default true)
Copy files/folders between a container and the local filesystem #用于容器与主机之间的数据拷贝
Use '-' as the source to read a tar archive from stdin and extract it to a directory destination in a container. Use '-' as the destination to stream a tar archive of a container source to stdout.
Aliases: docker container cp, docker cp
Options: -a, --archive Archive mode (copy all uid/gid information) -L, --follow-link Always follow symbol linkin SRC_PATH # 保持源目标中的链接 -q, --quiet Suppress progress output during copy. Progress output is automatically suppressed if no terminal is attached
拷贝容器ede86e41f39c中tmp目录下yum.log文件到宿主机root目录下
docker cp ede86e41f39c:/tmp/yum.log /root
将主机/tmp/test目录拷贝到容器96f7f14e99ab的/tmp目录下。
docker cp /tmp/test 96f7f14e99ab:/tmp/
将主机/tmp/test目录拷贝到容器96f7f14e99ab中,目录重命名为test2。
docker cp /tmp/test 96f7f14e99ab:/test2
将容器96f7f14e99ab的/tmp目录拷贝到主机的/tmp目录中。
docker cp 96f7f14e99ab:/tmp /tmp/
Docker镜像
UnionFS
UnionFS(联合文件系统):Union文件系统(UnionFS)是一种分层、轻量级并且高性能的文件系统,它支持对文件系统的修改作为一次提交来一层层的叠加,同时可以将不同目录挂载到同一个虚拟文件系统下(unite several directories into a single virtual filesystem)。Union 文件系统是 Docker 镜像的基础。镜像可以通过分层来进行继承,基于基础镜像(没有父镜像),可以制作各种具体的应用镜像。
IP : 47.100.24.6 地址 : 中国 上海 运营商 : 阿里云/电信/联通/移动/铁通/教育网
数据二 : 上海市 | 阿里云
数据三 : 中国上海上海 | 阿里云
URL : http://www.cip.cc/47.100.24.6
案例三:ONBUILD
[root@quan ~]# cd /myDocker/ [root@quan myDocker]# vim DockerFile FROM centos ENTRYPOINT ["curl","-s","cip.cc"] ONBUILD RUN echo "father images onbuild......" [root@quan myDocker]# docker build -f /myDocker/DockerFile -t myip/father:1.1 . [root@quan myDocker]# vim DockerFile2 FROM myip/father:1.1 ENTRYPOINT ["curl","-s","cip.cc"] [root@quan myDocker]# docker build -f /myDocker/DockerFile2 -t myip/son:1.1 . Sending build context to Docker daemon 3.072kB Step 1/2 : FROM myip/father:1.1 # Executing 1 build trigger ---> Running in 064d951dc6a7 father images onbuild...... Removing intermediate container 064d951dc6a7 ---> edd020a63c36 Step 2/2 : ENTRYPOINT ["curl","-s","cip.cc"] ---> Running in 2af6a39c0d54 Removing intermediate container 2af6a39c0d54 ---> 1db2bca3d182 Successfully built 1db2bca3d182 Successfully tagged myip/son:1.1 [root@quan myDocker]# cat DockerFile FROM centos ENTRYPOINT ["curl","-s","cip.cc"] ONBUILD RUN echo "father images onbuild......" # myip/son:1.1 继承自 myip/father:1.1,执行myip/father:1.1的ONBUILD,父类的ONBUILD被执行
案例五:自定义镜像Tomcat9
[root@quan /]# cd /myDocker/tomcat9/ [root@quan tomcat9]# touch c.txt [root@quan tomcat9]# ls -l total 166516 -rw-r--r-- 1 root root 11487016 Apr 3 11:27 apache-tomcat-9.0.44.tar.gz -rw-r--r-- 1 root root 0 Apr 3 11:21 c.txt -rw-r--r-- 1 root root 159019376 Apr 3 11:28 jdk-8u11-linux-x64.tar.gz [root@quan tomcat9]# vim DockerFile FROM centos MAINTAINER ljq<ljq@126.com> #把宿主机当前上下文的c.txt拷贝到容器/usr/local/路径下并重命名 COPY c.txt /usr/local/cincontainer.txt #把java与tomcat添加到容器中 ADD jdk-8u11-linux-x64.tar.gz /usr/local/ ADD apache-tomcat-9.0.44.tar.gz /usr/local/ #安装vim编辑器 RUN yum -y install vim #设置工作访问时候的WORKDIR路径,登录落脚点 ENV MYPATH /usr/local WORKDIR $MYPATH #配置java与tomcat环境变量 ENV JAVA_HOME /usr/local/jdk1.8.0_11 ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar ENV CATALINA_HOME /usr/local/apache-tomcat-9.0.44 ENV CATALINA_BASE /usr/local/apache-tomcat-9.0.44 ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/lib:$CATALINA_HOME/bin #容器运行时监听的端口 EXPOSE 8080 #启动时运行tomcat # ENTRYPOINT ["/usr/local/apache-tomcat-9.0.44/bin/startup.sh" ] # CMD ["/usr/local/apache-tomcat-9.0.44/bin/catalina.sh","run"] CMD /usr/local/apache-tomcat-9.0.44/bin/startup.sh && tail -F /usr/local/apache-tomcat-9.0.44/bin/logs/catalina.out [root@quan tomcat9]# docker build -f /myDocker/tomcat9/DockerFile -t mytomcat9 . [root@quan tomcat9]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE mytomcat9 latest 53af9d756618 5 minutes ago 607MB [root@quan tomcat9]# docker run -d -p 9080:8080 --name myt9 -v /myDocker/tomcat9/test:/usr/local/apache-tomcat-9.0.44/webapps/test -v /myDocker/tomcat9/tomcat9logs/:/usr/local/apache-tomcat-9.0.44/logs --privileged=true mytomcat9 [root@quan tomcat9]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES c524b2450a6c mytomcat9 "/bin/sh -c '/usr/lo…" 27 seconds ago Up 24 seconds 0.0.0.0:9080->8080/tcp myt9 [root@quan tomcat9]# ls -l total 166528 -rw-r--r-- 1 root root 11487016 Apr 3 11:27 apache-tomcat-9.0.44.tar.gz -rw-r--r-- 1 root root 0 Apr 3 11:21 c.txt -rw-r--r-- 1 root root 1037 Apr 3 11:39 DockerFile -rw-r--r-- 1 root root 159019376 Apr 3 11:28 jdk-8u11-linux-x64.tar.gz drwxr-xr-x 2 root root 4096 Apr 3 12:07 test drwxr-xr-x 2 root root 4096 Apr 3 12:07 tomcat9logs [root@quan tomcat9]# docker exec c524b2450a6c ls -l # 这里查询的是/usr/local目录下的文件,因为落脚点是/usr/local total 56 drwxr-xr-x 3 root root 4096 Apr 3 04:08 aegis drwxr-xr-x 1 root root 4096 Apr 3 03:53 apache-tomcat-9.0.44 drwxr-xr-x 2 root root 4096 Nov 3 15:22 bin -rw-r--r-- 1 root root 0 Apr 3 03:21 cincontainer.txt drwxr-xr-x 2 root root 4096 Nov 3 15:22 etc drwxr-xr-x 2 root root 4096 Nov 3 15:22 games drwxr-xr-x 2 root root 4096 Nov 3 15:22 include drwxr-xr-x 8 10 143 4096 Jun 17 2014 jdk1.8.0_11 drwxr-xr-x 2 root root 4096 Nov 3 15:22 lib drwxr-xr-x 3 root root 4096 Dec 4 17:37 lib64 drwxr-xr-x 2 root root 4096 Nov 3 15:22 libexec drwxr-xr-x 2 root root 4096 Nov 3 15:22 sbin drwxr-xr-x 5 root root 4096 Dec 4 17:37 share drwxr-xr-x 2 root root 4096 Nov 3 15:22 src [root@quan ~]# docker exec c524b2450a6c java -version java version "1.8.0_11" Java(TM) SE Runtime Environment (build 1.8.0_11-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)
Docker常用安装
安装tomcat
[root@quan ~]# docker search tomcat NAME DESCRIPTION STARS OFFICIAL AUTOMATED tomcat Apache Tomcat is an open source implementati… 2989 [OK] [root@quan ~]# docker pull tomcat [root@quan ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE tomcat latest 040bdb29ab37 2 months ago 649MB [root@quan ~]# docker run -it -p 8080:8080 tomcat [root@quan ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 3fa8eeb70cf9 tomcat "catalina.sh run" 44 seconds ago Up 40 seconds 0.0.0.0:8080->8080/tcp brave_maxwell
安装mysql
[root@quan ~]# docker search mysql [root@quan ~]# docker pull mysql [root@quan ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE mysql latest c8562eaf9d81 2 months ago 546MB [root@quan ~]# docker run -p 3306:3306 --name mysql -v /usr/local/mysql/conf:/etc/mysql/conf.d -v /usr/local/mysql/logs:/logs -v /usr/local/mysql/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.6 [root@quan ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e34e861b5719 mysql:5.6 "docker-entrypoint.s…" 9 seconds ago Up 7 seconds 0.0.0.0:3306->3306/tcp mysql [root@quan ~]# docker exec -it e34e861b5719 /bin/bash root@e34e861b5719:/# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7 Server version: 5.6.50 MySQL Community Server (GPL)
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | test | +--------------------+ 4 rows in set (0.03 sec)
安装redis
[root@quan ~]# docker search redis [root@quan ~]# docker pull redis [root@quan ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE redis latest 621ceef7494a 2 months ago 104MB [root@quan ~]# docker run -p 6379:6379 -v /usr/local/myredis/data:/data -v /usr/local/myredis/conf/redis.conf:/usr/local/etc/redis/redis.conf -d redis redis-server /usr/local/etc/redis/redis.conf --appendonly yes [root@quan ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ae5139dfe541 redis "docker-entrypoint.s…" 8 seconds ago Up 6 seconds 0.0.0.0:6379->6379/tcp cranky_allen [root@quan ~]# docker exec -it ae5139dfe541 redis-cli 127.0.0.1:6379> set k1 v1 OK 127.0.0.1:6379> set k2 v2 OK 127.0.0.1:6379> keys * 1) "k1" 2) "k2"
本地镜像发布到阿里云
[root@quan ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE redis latest 621ceef7494a 2 months ago 104MB [root@quan ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 59e937d759b7 redis "docker-entrypoint.s…" 35 seconds ago Up 32 seconds 0.0.0.0:6379->6379/tcp thirsty_roentgen [root@quan ~]# docker commit -a ljq -m "my new redis" 59e937d759b7 myredis:1.1 [root@quan ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE myredis 1.1 0a7a7dca8c28 13 seconds ago 104MB redis latest 621ceef7494a 2 months ago 104MB [root@quan ~]# docker login --username=1032905347@qq.com registry.cn-shanghai.aliyuncs.com Password: WARNING! Your password will be stored unencrypted in /root/.docker/config.json. Configure a credential helper to remove this warning. See https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded [root@quan ~]# docker tag 0a7a7dca8c28 registry.cn-shanghai.aliyuncs.com/lianjq/myredis:1.1.2 [root@quan ~]# docker push registry.cn-shanghai.aliyuncs.com/lianjq/myredis:1.1.2 The push refers to repository [registry.cn-shanghai.aliyuncs.com/lianjq/myredis] b2ee95f92839: Pushed 3480f9cdd491: Pushed a24a292d0184: Pushed f927192cc30c: Pushed 1450b8f0019c: Pushed 8e14cb7841fa: Pushed cb42413394c4: Pushed 1.1.2: digest: sha256:11e88398a0298e90308e68c58082ec92eb70dd30919a523e2b98e2fec9b4973a size: 1779 [root@quan ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE myredis 1.1 0a7a7dca8c28 28 minutes ago 104MB redis latest 621ceef7494a 2 months ago 104MB [root@quan ~]# docker pull registry.cn-shanghai.aliyuncs.com/lianjq/myredis:1.1.2 [root@quan ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE myredis 1.1 0a7a7dca8c28 28 minutes ago 104MB registry.cn-shanghai.aliyuncs.com/lianjq/myredis 1.1.2 0a7a7dca8c28 28 minutes ago 104MB redis latest 621ceef7494a 2 months ago 104MB