Docker镜像的获取和推送
查找镜像
查找镜像的方法有主要有两种,一种是在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镜像的获取和推送的更多相关文章
- Docker 镜像&仓库 获取及推送镜像
docker查看.删除镜像 docker镜像存储位置: /var/lib/docker 查看docker信息也可以查看保存位置 docker info 1.列出镜像 docker images -aa ...
- Docker学习(6) 获取和推送镜像
查找镜像 拉取镜像 推送镜像 总结
- 利用奇偶数来获取websocket推送时间间隔(或者比较前一个数和下一个数的变化)
利用奇偶数来获取websocket推送时间间隔(或者比较前一个数和下一个数的变化) 在vue中的 data () { return { countTime: 0, newDat ...
- Docker 学习之镜像导入导出及推送阿里云服务器(三)
在前面两节里主要就是记录一些docker的基本的操作,包括搜索镜像,拉取镜像,根据镜像创建容器等等,在这一节主要就是记录Docker对于镜像文件的导入导出,及推送到阿里云再从阿里云获取镜像. 一.镜像 ...
- 🏆【CI/CD技术专题】「Docker实战系列」(1)本地进行生成镜像以及标签Tag推送到DockerHub
背景介绍 Docker镜像构建成功后,只要有docker环境就可以使用,但必须将镜像推送到Docker Hub上去.创建的镜像最好要符合Docker Hub的tag要求,因为在Docker Hub注册 ...
- docker 源码分析 四(基于1.8.2版本),Docker镜像的获取和存储
前段时间一直忙些其他事情,docker源码分析的事情耽搁了,今天接着写,上一章了解了docker client 和 docker daemon(会启动一个http server)是C/S的结构,cli ...
- Docker镜像的获取与删除
Docker运行容器前需要本地存在对应的镜像,如果镜像不存在本地,Docker会尝试先从默认镜像仓库下载(默认使用Dicker Hub公共注册服务器中的仓库),用户也可以通过配置,使用自定义的镜像仓库 ...
- 解决跟Docker私有仓库登陆,推送,拉取镜像出现的报错
出现问题:Error response from daemon: Get https://192.168.186.120/v1/users/: dial tcp 192.168.186.120:443 ...
- rsync 简单使用 非默认ssh端口 分别从远程获取及推送本地的文件到远程
rsync: did not see server greetingrsync error: error starting client-server protocol (code 5) at mai ...
随机推荐
- unidbgrid列排序
unidbgrid列排序 1)指定列的.sortable:=true; 2)unidbgrid.columnsort事件添加如下代码: if SameText(Column.FieldName, 'I ...
- Android-Failed to open zip file
当AndroidStudio加载工程的时候,出现以下错误❌: 解决前的工程目录: 1.将以上错误认真的分析: 2.找到工程的 gradle文件夹/wrapper文件夹/gradle-wrapper.p ...
- Android-Kotlin-单例模式
先看一个案例,非单例模式的案例: 描述Dog对象: package cn.kotlin.kotlin_oop08 class Dog(var name:String, var color:String ...
- iOS 百度地图截屏
关于百度地图截屏的问题,发现不能用常用的方法进行载屏,常用的截屏方法所得到的图片地图瓦片底图会显示空白,网上给出的答案是这样的 :因为百度地图不是用UIKit实现的,所以得不到截图! 不过通过Open ...
- CVPR2013总结
前不久CVPR的结果出来了,首先恭喜我一个已经毕业工作的师弟中了一篇文章.完整的文章列表已经在CVPR的主页上公布了(链接),今天把其中一些感兴趣的整理一下,虽然论文下载的链接大部分还都没出来,不过可 ...
- 【计算机网络】 网络体系结构分类: 客户机/服务器体系和P2P
网络体系结构的分类 现代网络应用程序有两种主流的体系结构: 客户机/服务器体系结构和P2P体系结构(peer to peer “对等”) 一 . 客户机/服务器体系结构 客户机/服务器体系 ...
- 【BZOJ1053】 反素数ant
BZOJ1053 反素数ant 我们先考虑唯一分解定理求出约数个数: \(x=a_1^{p_1}a_2^{p_2}a_3^{p_3}...a_k^{p_k}\) 然后\(num=\Pi_{i=1}^k ...
- 使用solr crud 的三种方式(了该)
1.solrJ 实际是http 请/响 2.spring data solr 实际是对官方类库(solrJ)的封装 3.使用httpClient 手动请求
- PHP程序员职业发展路线
重点:把LNMP搞熟练(核心是安装配置基本操作) 1.Linux: 基本命令.操作.启动.基本服务配置(包括rpm安装文件,各种服务配置等): 会写简单的shell脚本和awk/sed 脚本命令等. ...
- python--使用pickle序列化对象
pickle序列化对象 如果希望透明地存储 Python 对象,而不丢失其身份和类型等信息,则需要某种形式的对象序列化:它是一个将任意复杂的对象转成对象的文本或二进制表示的过程. 同样,必须能够将对象 ...