Docker系列(6)- 常用命令(2) | 镜像命令
准备工作
- 知道查看官方文档,官方文档描述的很详细,并且每一种类型。每一个命令的选项都有例子
- 会使用docker --help查看


镜像命令
docker images 查看所有本地主机上的镜像
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest d1165f221234 5 months ago 13.3kB # 解释
REPOSITORY 镜像的仓库源
TAG 镜像的标签;版本
IMAGE ID 镜像的id
CREATED 镜像的创建时间
SIZE 镜像的大小 # 可选项
-a, --all 列出所有的镜像
-q, --quiet 只显示镜像的id
docker search 搜索镜像
[root@localhost ~]# docker search mysql
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
mysql MySQL is a widely used, open-source relation… 11315 [OK]
mariadb MariaDB Server is a high performing open sou… 4302 [OK]
#可选项,通过收藏来过滤
--filter=STARS=3000 #搜索出来的镜像就是STARS大于3000的
[root@localhost ~]# docker search mysql --filter=STARS=5000
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
mysql MySQL is a widely used, open-source relation… 11315 [OK]

docker pull 下载镜像
# 下载镜像 docker pull 镜像名[:tag]
[root@localhost ~]# docker pull mysql
Using default tag: latest #如果不写tag,默认就是latest最新的
latest: Pulling from library/mysql
e1acddbe380c: Pull complete #分层下载,docker image的核心 联合文件系统
bed879327370: Pull complete
03285f80bafd: Pull complete
ccc17412a00a: Pull complete
1f556ecc09d1: Pull complete
adc5528e468d: Pull complete
1afc286d5d53: Pull complete
6c724a59adff: Pull complete
0f2345f8b0a3: Pull complete
c8461a25b23b: Pull complete
3adb49279bed: Pull complete
77f22cd6c363: Pull complete
Digest: sha256:d45561a65aba6edac77be36e0a53f0c1fba67b951cb728348522b671ad63f926 #签名,防伪
Status: Downloaded newer image for mysql:latest
docker.io/library/mysql:latest #真实地址
#等价于它
docker pull mysql
docker pull docker.io/library/mysql:latest

# 指定版本下载,仓库指定的tag必须得存在

[root@localhost ~]# docker pull mysql:5.7
5.7: Pulling from library/mysql
e1acddbe380c: Already exists
bed879327370: Already exists
03285f80bafd: Already exists
ccc17412a00a: Already exists
1f556ecc09d1: Already exists
adc5528e468d: Already exists
1afc286d5d53: Already exists
4d2d9261e3ad: Pull complete
ac609d7b31f8: Pull complete
53ee1339bc3a: Pull complete
b0c0a831a707: Pull complete
Digest: sha256:7cf2e7d7ff876f93c8601406a5aa17484e6623875e64e7acc71432ad8e0a3d7e
Status: Downloaded newer image for mysql:5.7
docker.io/library/mysql:5.7

docker rmi 删除镜像
[root@localhost ~]# docker rmi -f 镜像id #删除指定得镜像
[root@localhost ~]# docker rmi -f 镜像1id 镜像2id 镜像3id #删除多个镜像
[root@localhost ~]# docker rmi -f $(docker images -aq) #删除全部镜像,$()就好像Linux得管道符一样
Docker系列(6)- 常用命令(2) | 镜像命令的更多相关文章
- Docker系列之常用命令操作手册
目录 1.安装虚拟机 2.安装Docker 3.Docker镜像操作 4.Docker容器操作 Docker系列之常用命令操作手册 继上一篇博客Docker系列之原理简单介绍之后,本博客对常用的Doc ...
- docker常用命令、镜像命令、容器命令、数据卷,使用dockerFile创建镜像,dockefile的语法规则。
一.docker常用命令? 1. 常用帮助命令 1.1 docker的信息以及版本号 /* docker info 查看docker的信息 images2 docker本身就是一个镜像. docker ...
- Docker系列06—基于容器制作镜像并上传到Docker Registry
本文收录在容器技术学习系列文章总目录 1.制作镜像 1.1 镜像的生成途径 基于容器制作 dockerfile,docker build 本篇主要详细讲解基于容器制作镜像:基于dockerfile 制 ...
- docker系列(二):镜像
1 引言 将docker与汽车生产线类比,如果说docker引擎是汽车生产车间,那么容器就是最终的产品——汽车,而本节要介绍的镜像就如同汽车设计图纸,其重要性不言而喻——只有有了设计图(镜像),才能生 ...
- Docker系列(三)常用命令
命令说明 docker pull 格式: docke pull [OPTIONS] NAME[:TAG] 作用:下载名称为 name 的镜像 例子: sudo docker pull dl.docke ...
- Docker 系列之 常用镜像
Ubuntu 实战 操作 # 拉取 18.04 版本的 Ubuntu 镜像 docker pull ubuntu:latest # 以交互方式运行并进入 ubuntu 容器环境 docker run ...
- Docker系列(15)- Commit镜像
docker commit 提交容器成为一个新的副本,有点像套娃 # 命令和git原理类似 docker commit -m="提交的描述信息" -a="作者" ...
- Docker系列(26)- 发布镜像到阿里云容器服务
1.登录阿里云 2.找到容器镜像服务 3.创建命名空间 4.创建镜像仓库 5.上传镜像
- Docker系列07—Dockerfile 详解
本文收录在容器技术学习系列文章总目录 1.认识Dockerfile 1.1 镜像的生成途径 基于容器制作 dockerfile,docker build 基于容器制作镜像,已经在上篇Docker系列 ...
随机推荐
- go配置私有仓库 (go mod配置私有仓库)
windows 配置go私有仓库 一.环境 1.私有gitlab (gitlab.xxx.com) 2.go 1.16.3 3.win10系统, 家目录:C:\Users\Administrator, ...
- Git(7)-- 查看提交历史(git log 命令详解)
@ 目录 1.git clone 2.git log 3.git log -p 4.git log --stat 5.git log --pretty=oneline 6.git log --pret ...
- echatrts 各参数快速了解(+实例)
实例:https://www.jianshu.com/p/8cac22daca98 参数详解:https://echarts.baidu.com/option.html#title.textStyle ...
- C#设计模式---迭代器模式(Iterator Pattern)
一.目的 提供一种方法访问一个容器对象中各个元素,而又不需暴露该对象的内部细节. 二.定义 迭代器模式提供了一种方法访问一个聚合对象(理解为集合对象)中各个元素,而又无需暴露该对象的内部表示,这样既可 ...
- 【springcloud】Eureka服务注册中心搭建
转自:https://blog.csdn.net/pengjunlee/article/details/86538997 Spring Cloud是一系列框架的集合,它利用Spring Boot的开发 ...
- JDBC基础篇(MYSQL)——通过JDBC连接数据库的三种方式
package day01_jdbc; import java.sql.Connection; import java.sql.Driver; import java.sql.DriverManage ...
- Spring之AspectJ
时间:2017-2-4 21:12 --AspectJ简介1.AspectJ是一个基于Java语言的AOP框架.2.Spring2.0以后新增了对AspectJ切点表达式的支持.3.@AspectJ是 ...
- cmd(命令行 )的命令
cmd是command的缩写.即命令行 CMD命令锦集 1. gpedit.msc-----组策略 2. sndrec32-------录音机 3. Nslookup-------IP地址侦测器 ,是 ...
- vue 手写倒计时,样式需要自己调。( 亲测可用,就是没有样式 )
先写一个 js 文件,这个文件是工具类文件,需要单独开一个js // 计算出时间戳的具体数据:比如将85400转化为 n天n时n分n秒 export function formateTimeStamp ...
- MyBatis学习总结(五)——关联表查询的实现
一.一对一关联 1.1.提出需求 根据班级id查询班级信息(带老师的信息) 1.2.创建表和数据 创建一张教师表和班级表,这里我们假设一个老师只负责教一个班,那么老师和班级之间的关系就是一种一对一的关 ...


