- 镜像是容器运行的前提.
-
能够利用docker的pull命令从网络上下载镜像,命令格式: docker pull NAME[:TAG]. 对于docker镜像来讲,若是不显式的指定TAG,则默认会选择latest标签,就是下载镜像库中最新的版本.
-
下面演示的是从Docker Hub的Ubuntu仓库下载一个最新的Ubuntu操做系统的(不指定版本,默认为latest)镜像
- 该命令实际上下载的就是ubuntu:latest镜像,目前最新的ubuntu镜像.
-
至关于 sudo docker pull registry.hub.docker.con/ubuntu:latest 命令,便是从默认的注册服务器registry.hub.docker.com中的ubuntu仓库下载标记为latest的镜像!
-
下载过程当中能够看出,镜像文件通常由若干层组成,行首的02658b5e0e10这样的字符串表明了各层的ID.下载过程当中会获取并输出镜像的各层信息.层(layer) 实际上是AUFS(Advanced Union File System,一种文件联合系统)中的重要概念,是实现增量保存与更新的基础.
-
还能够经过指定标签来下载特定版本的一某一个镜像,例如14.04标签的镜像
-
固然了,你也能够从其余注册服务器的仓库中下载!此时,须要在仓库名称前指定完整的仓库注册服务器地址,例如从DaoCloud社区下载一个镜像.
- [root@Ninemax-LPC3 ~]# docker pull daocloud.io/library/nginx:latest
- latest: Pulling from daocloud.io/library/nginx
- 7444805dc220: Downloading [========> ] 3.82 MB/22.42 MB
- 7444805dc220: Downloading [================> ] 7.414 MB/22.42 MB
- 7444805dc220: Downloading [==================> ] 8.088 MB/22.42 MB
- 7444805dc220: Downloading [===================> ] 8.538 MB/22.42 MB
- 7444805dc220: Pull complete
- 2de46b59641d: Pull complete
- 6f5118869c74: Pull complete
- 476175996aa4: Pull complete
- 275a07ec63cd: Pull complete
- fda55200fa9a: Pull complete
- c9b35ae20342: Pull complete
- 97e1acb823af: Pull complete
- c95c61c2cc3e: Pull complete
- bb8f1ef45c26: Pull complete
- Digest: sha256:8deedf6e64e06d976d4a8697bc3294f3c3e65ccf6367850abcc9de4b94784b87
- Status: Downloaded newer image for daocloud.io/library/nginx:latest
-
上面的命令就是咱们从 daocloud下载的 一个 NAME为nginx TAG 为latest的一个镜像!