查找镜像

  查找镜像的方法有主要有两种,一种是在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. sentiwordnet的简单使用

    # Example line: # POS     ID     PosS  NegS SynsetTerm#sentimentscore    Desc # a   00009618  0.5    ...

  2. react项目开发中遇到的问题

    前言 作为一个前端爱好者来说,都想在react上一试生手,那么在搭建react项目开发时,肯定会有这样或者那样的问题,尤其是对初学者来说,下面就个人在开发过程中遇到的问题总结一下,好在有google帮 ...

  3. 「PKUWC2019」拓扑序计数(状压dp)

    考场只打了 \(52\) 分暴力...\(ljc\) 跟我说了一下大致思路,我回去敲了敲. \(f[i]\) 表示状态为 \(i\) 时的方案数.我们用二进制 \(0/1\) 表示不选/选点 \(i\ ...

  4. 深度学习:浅谈RNN、LSTM+Kreas实现与应用

    主要针对RNN与LSTM的结构及其原理进行详细的介绍,了解什么是RNN,RNN的1对N.N对1的结构,什么是LSTM,以及LSTM中的三门(input.ouput.forget),后续将利用深度学习框 ...

  5. Lua C API 遍历 table

    http://timothyqiu.com/archives/lua-note-table-traversal-using-c-api/ C API 遍历 Table lua_getglobal(L, ...

  6. Mac下IDE无法读取环境变量问题

    今天遇到一个问题,Idea无法读取~/.bash_profile下的配置文件. 上网查了好久,都说是launchctl的问题. 但是其实我这边是因为安装了zsh,导致环境标量失效. 在~/.zshrc ...

  7. file_put_contents 换行

    file_put_contents('test.text', json_encode($result) . PHP_EOL, FILE_APPEND);

  8. Liferay7 BPM门户开发之1:Liferay7开发环境准备

    liferay sdk下载 \IDE下载 \ Tomcat 安装细节不在此赘述 网上有很多. 只讲核心关键坑点 进入2016年,从Liferay6.2.5 ga6版本开始,到7.0 ga3,在ivy环 ...

  9. Unity项目接入应用宝SDK实现截图功能

    Unity项目接入应用宝SDK实现截图功能 问题由来 点击应用宝悬浮窗 如图所示 左下角有一个截图按钮 需要解决那些问题 截图信息需要由游戏引擎提供 SDK获取截图信息为同步 但是Unity引擎没有提 ...

  10. 04-01 Java switch、for、while、do while语句,循环嵌套,跳转语句break、continue、return

    语句 1:switch语句(掌握) (1)格式: switch(表达式) { case 值1: 语句体1; break; case 值2: 语句体2; break; ... default: 语句体n ...