查找镜像

  查找镜像的方法有主要有两种,一种是在Docker Hub官方网站查找,网址为https://hub.docker.com/

  另一种方法是在命令行界面中通过docker serach <image>来查找相关的镜像。

  docker search命令说明:

docker search [options] TERM
--authomated=false Only show automated builds
--no-trunc=false Don't truncate output
-s,--stars=0 Only displays with at least x stars
最多返回25个结果

  docker search ubuntu结果:

[root@docker ~]# docker search ubuntu
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
ubuntu Ubuntu is a Debian-based Linux operating s... 6281 [OK]
rastasheep/ubuntu-sshd Dockerized SSH service, built on top of of... 91 [OK]
ubuntu-upstart Upstart is an event-based replacement for ... 74 [OK]
neurodebian NeuroDebian provides neuroscience research... 37 [OK]
ubuntu-debootstrap debootstrap --variant=minbase --components... 30 [OK]
32bit/ubuntu Ubuntu for i386 (32bit) 30
armhf/ubuntu Ubuntu is a Debian-based Linux operating s... 27
nuagebec/ubuntu Simple always updated Ubuntu docker images... 22 [OK]
tutum/ubuntu Simple Ubuntu docker images with SSH access 18
ppc64le/ubuntu Ubuntu is a Debian-based Linux operating s... 10
aarch64/ubuntu Ubuntu is a Debian-based Linux operating s... 9
sameersbn/ubuntu 9 [OK]
i386/ubuntu Ubuntu is a Debian-based Linux operating s... 7
nimmis/ubuntu This is a docker images different LTS vers... 7 [OK]
darksheer/ubuntu Base Ubuntu Image -- Updated hourly 3 [OK]
libmesos/ubuntu 3
scaleway/ubuntu Ubuntu image on Scaleway 2
webhippie/ubuntu Docker images for ubuntu 1 [OK]
vcatechnology/ubuntu A Ubuntu image that is updated daily 1 [OK]
s390x/ubuntu Ubuntu is a Debian-based Linux operating s... 1
konstruktoid/ubuntu Ubuntu base image 0 [OK]
smartentry/ubuntu ubuntu with smartentry 0 [OK]
ossobv/ubuntu Custom ubuntu image from scratch (based on... 0
defensative/socat-ubuntu 0 [OK]
pivotaldata/ubuntu A quick freshening-up of the base Ubuntu d... 0
[root@docker ~]#

  查找3星以上的ubuntu镜像:

[root@docker ~]# docker search -s 3 ubuntu
Flag --stars has been deprecated, use --filter=stars=3 instead
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
ubuntu Ubuntu is a Debian-based Linux operating s... 6281 [OK]
rastasheep/ubuntu-sshd Dockerized SSH service, built on top of of... 91 [OK]
ubuntu-upstart Upstart is an event-based replacement for ... 74 [OK]
neurodebian NeuroDebian provides neuroscience research... 37 [OK]
ubuntu-debootstrap debootstrap --variant=minbase --components... 30 [OK]
32bit/ubuntu Ubuntu for i386 (32bit) 30
armhf/ubuntu Ubuntu is a Debian-based Linux operating s... 27
nuagebec/ubuntu Simple always updated Ubuntu docker images... 22 [OK]
tutum/ubuntu Simple Ubuntu docker images with SSH access 18
ppc64le/ubuntu Ubuntu is a Debian-based Linux operating s... 10
aarch64/ubuntu Ubuntu is a Debian-based Linux operating s... 9
sameersbn/ubuntu 9 [OK]
i386/ubuntu Ubuntu is a Debian-based Linux operating s... 7
nimmis/ubuntu This is a docker images different LTS vers... 7 [OK]
darksheer/ubuntu Base Ubuntu Image -- Updated hourly 3 [OK]
libmesos/ubuntu 3
[root@docker ~]#

  拉取镜像

  镜像通过"docker pull <image>"拉取。

  docker pull命令简单说明:

docker pull [options] NAME[:TAG]
-a,--all-tags=false Download all tagged images in the repository

  拉取ubuntu:14.04镜像:

[root@CentOS7 ~]# docker pull ubuntu:14.04
14.04: Pulling from library/ubuntu
cb56c90f0b30: Pull complete
0acc551e5716: Pull complete
8956dcd35143: Pull complete
908242721214: Pull complete
b44ff14dd3bb: Pull complete
Digest: sha256:5faf6cb681da2be979a177b60d8c18497f962e3d82268c49db6c74008d0c294d
Status: Downloaded newer image for ubuntu:14.04
[root@CentOS7 ~]#

  拉取成功后可以通过docker images查看本地镜像:

[root@CentOS7 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
jie/df_test1 latest cd7c340503bc 3 hours ago 214MB
centos/nginx latest e5faa74eeb5d 5 hours ago 401MB
php latest 2dbd5ab1d9f5 4 days ago 370MB
nginx latest e4e6d42c70b3 5 days ago 107MB
centos latest 36540f359ca3 11 days ago 193MB
registry latest c2a449c9f834 2 weeks ago 33.2MB
mysql latest 44a8e1a5c0b2 3 weeks ago 407MB
ubuntu latest d355ed3537e9 3 weeks ago 119MB
ubuntu 14.04 4a2820e686c4 3 weeks ago 188MB
daocloud.io/daocloud/daocloud-toolset latest bbdc71e950ea 4 months ago 147MB
[root@CentOS7 ~]#

  由于国内的特殊原因,镜像拉取特别慢,很容易下载失败。所以我们可以使用加速器来加速下载,提高下载成功率,现有的比如网易蜂巢加速器、阿里云加速器和daocloud加速器等。可以根据自己喜好选用。

  推送镜像(需要拥有Docker Hub的账号)

  我们自己构建镜像之后可以通过docker push <image>将自己的镜像推送至Docker Hub仓库中,前提是需要有自己的Docker Hub账号。免费的账号只能有一个存储空间,当然Docker Hub支持付费服务,增加可用空间。

[root@docker ~]# docker push jie/df_test1
The push refers to a repository [docker.io/jie/df_test1]
sending image list please login prior to push:
Username:staryjie
Password:
Email:fngje0128@163.com
Login Successed
The push refers to a repository [docker.io/jie/df_test1]
f5456bfd299d: Pushing
8f2ab3b3ad55: Waiting
0566c118947e: Preparing
6f9cf951edf5: Waiting
182d2a55830d: Preparing
5a4c2c9a24fc: Preparing
cb11ba605400: Waiting

  等待push完成,上传完成之后即可在Docker Hub中自己的仓库中看到,也可以通过网页搜索查看,如果不想公开,也可以设置镜像为个人,这样别人就无法查看到你的镜像了。

Docker镜像的获取和推送的更多相关文章

  1. Docker 镜像&仓库 获取及推送镜像

    docker查看.删除镜像 docker镜像存储位置: /var/lib/docker 查看docker信息也可以查看保存位置 docker info 1.列出镜像 docker images -aa ...

  2. Docker学习(6) 获取和推送镜像

    查找镜像 拉取镜像 推送镜像 总结

  3. 利用奇偶数来获取websocket推送时间间隔(或者比较前一个数和下一个数的变化)

    利用奇偶数来获取websocket推送时间间隔(或者比较前一个数和下一个数的变化) 在vue中的 data () {     return { countTime: 0,         newDat ...

  4. Docker 学习之镜像导入导出及推送阿里云服务器(三)

    在前面两节里主要就是记录一些docker的基本的操作,包括搜索镜像,拉取镜像,根据镜像创建容器等等,在这一节主要就是记录Docker对于镜像文件的导入导出,及推送到阿里云再从阿里云获取镜像. 一.镜像 ...

  5. 🏆【CI/CD技术专题】「Docker实战系列」(1)本地进行生成镜像以及标签Tag推送到DockerHub

    背景介绍 Docker镜像构建成功后,只要有docker环境就可以使用,但必须将镜像推送到Docker Hub上去.创建的镜像最好要符合Docker Hub的tag要求,因为在Docker Hub注册 ...

  6. docker 源码分析 四(基于1.8.2版本),Docker镜像的获取和存储

    前段时间一直忙些其他事情,docker源码分析的事情耽搁了,今天接着写,上一章了解了docker client 和 docker daemon(会启动一个http server)是C/S的结构,cli ...

  7. Docker镜像的获取与删除

    Docker运行容器前需要本地存在对应的镜像,如果镜像不存在本地,Docker会尝试先从默认镜像仓库下载(默认使用Dicker Hub公共注册服务器中的仓库),用户也可以通过配置,使用自定义的镜像仓库 ...

  8. 解决跟Docker私有仓库登陆,推送,拉取镜像出现的报错

    出现问题:Error response from daemon: Get https://192.168.186.120/v1/users/: dial tcp 192.168.186.120:443 ...

  9. rsync 简单使用 非默认ssh端口 分别从远程获取及推送本地的文件到远程

    rsync: did not see server greetingrsync error: error starting client-server protocol (code 5) at mai ...

随机推荐

  1. UVA12888 【Count LCM】(莫比乌斯反演)

    题意:求\(\sum_{i=1}^{n}\sum_{j=1}^{m}[gcd(i,j)==1]\) \(assume\ n<m\) \(\sum_{i=1}^{n}\sum_{j=1}^{m}[ ...

  2. 18_python_类关系

    一.类与类之间的关系          1.依赖关系 class Elephant: def __init__(self, name): self.name = name def open(self, ...

  3. spring cloud学习(六) 配置中心-自动更新

    上一篇学习了spring cloud config的基本使用,但发现有个问题,就是每次更改配置后,都需要重启服务才能更新配置,这样肯定是不行的.在上网查资料了解后,spring cloud支持通过AM ...

  4. Git-遇到的问题以及解决方法

    1.将本地内容推送到远程仓库后,远程仓库里的文件夹不可点击 原因:在本地添加文件夹A时,又在A里使用了git init命令 解决:删除文件夹A,再重新添加过 2.其他人推送不了内容到远程仓库 原因:权 ...

  5. drf-序列化器的理解

    序列化器作用:  1.进行数据的校验 2.对数据对象进行转换 序列化:  模型类对象  ----->  python字典    用于输出, 返回给前端使用 反序列化:  前端传送的数据  --- ...

  6. 如何在vue中全局引入stylus文件的公共变量

    新建 一个公共的stylus公共文件添加公共变量,如下: 修改下图圈出的文件: 具体的修改如下: // generate loader string to be used with extract t ...

  7. widows下 python环境变量配置

    widows下 python环境变量配置 便于cmd命令行操作,例如:直接进入Python解释器环境.使用pip安装模块等.

  8. MVC3学习:利用mvc3+ajax检测用户是否被注册

    假设用户名是保存在表Users中.关系模式为Users(Uid,UserName,PassWord) 可先利用mvc自带的模板生成Create页面. 将填写用户名的地方,由原来的 <div cl ...

  9. c++拷贝构造函数(深拷贝、浅拷贝)——转

    拷贝构造函数: 拷贝构造函数是一种特殊的构造函数,函数的名称必须和类名称一致,它的唯一的一个参数是本类的一个引用变量,该参数是const类型,不可变的.例如:类A的拷贝构造函数的形式为A(A& ...

  10. FineBI学习系列之FineBI的ETL处理(图文详解)

    不多说,直接上干货! 这是来自FineBI官网提供的帮助文档 http://help.finebi.com/http://help.finebi.com/doc-view-48.html 目录: 1. ...