失效链接处理 |
Docker学习 PDF 下载
本站整理下载:
相关截图:
![]()
主要内容:
帮助命令
帮助文档的地址:https://docs.docker.com/reference/
镜像命令
docker images 查看所有本地的主机上的镜像
docker search 搜索镜像
docker version #显示docker的版本信息
docker info #显示docker的系统信息,包括镜像和容器的数量
docker 命令 --help #帮助命令
root@tcheng:/home/tcheng# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest d1165f221234 4 months ago 13.3kB
#解释
REPOSITORY 镜像的仓库源
TAG 镜像的标签
IMAGE ID 镜像的id
CREATED 镜像的创建时间
SIZE 镜像的大小
#可选项
-a, --all #列出所有的镜像
-q, --quiet #只显示镜像的id
root@tcheng:/home/tcheng# docker search mysql
NAME DESCRIPTION
STARS OFFICIAL AUTOMATED
mysql MySQL is a widely used, open-source relation…
11147 [OK]
mariadb MariaDB Server is a high performing open sou…
4228 [OK]
mysql/mysql-server Optimized MySQL Server Docker images. Create…
829 [OK]
#可选项,通过搜索来过滤
--filter=STARS=3000 #搜索出来的镜像就是STARS大于3000的
root@tcheng:/home/tcheng# docker search mysql --filter=STARS=3000
NAME DESCRIPTION STARS OFFICIAL
AUTOMATED
mysql MySQL is a widely used, open-source relation… 11147 [OK]
mariadb MariaDB Server is a high performing open sou… 4228 [OK]
root@tcheng:/home/tcheng# docker search mysql --filter=STARS=5000
docker pull 下载镜像
NAME DESCRIPTION STARS OFFICIAL
AUTOMATED
mysql MySQL is a widely used, open-source relation… 11147 [OK]
#下载镜像 docker pull 镜像名[:tag]
root@tcheng:/home/tcheng# docker pull mysql
Using default tag: latest #如果不写tag,默认就是latest
latest: Pulling from library/mysql
b4d181a07f80: Pull complete #分层下载,docker image的核心,联合文件系统
a462b60610f5: Pull complete
578fafb77ab8: Pull complete
524046006037: Pull complete
d0cbe54c8855: Pull complete
aa18e05cc46d: Pull complete
fd6f649b1d0a: Pull complete
2a97d48c2fdc: Pull complete
30f0c7db48fc: Pull complete
f5dda8df049e: Pull complete
671b83fd7448: Pull complete
5d9cc55fa997: Pull complete
Digest: sha256:18d8d109aa64673c78aebfb845b929cfdac97a553332f4310f4de8d67ceb03d2
#签名
Status: Downloaded newer image for mysql:latest
docker.io/library/mysql:latest #真实地址
#等价于它
docker pull mysql
docker pull docker.io/library/mysql:latest
#指定版本下载
root@tcheng:/home/tcheng# docker pull mysql:5.7
5.7: Pulling from library/mysql
b4d181a07f80: Already exists
a462b60610f5: Already exists
578fafb77ab8: Already exists
524046006037: Already exists
d0cbe54c8855: Already exists
aa18e05cc46d: Already exists
fd6f649b1d0a: Already exists
8a2b858b000b: Pull complete
322182b17422: Pull complete
070e28050a88: Pull complete
613bdfd8796e: Pull complete
Digest: sha256:956e11ac581cad9ac8747a9a1d61b8ffcfa6845e0f23bdbab6ba20a2ad792cbf
Status: Downloaded newer image for mysql:5.7
docker.io/library/mysql:5.7
|