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 ...
随机推荐
- Windows远程桌面连接ubuntu 16
一.安装Xrdp Windows远程桌面使用的是RDP协议,所以ubuntu上就要先安装Xrdp,在ubuntu软件中心搜索xrdp安装. 安装xrdp的同时会自动安装vnc4server,xbase ...
- 基于tkinter的九型人格测试系统介绍
基于tkinter的九型人格测试系统介绍 一.程序代码地址,GitHub 二.程序介绍 1.login.py 登录界面: 注册界面: 2.mainWindow.py 登录成功之后的界面: 3.doTe ...
- 02_python_while循环/格式化输出/逻辑运算
一. while循环 1.基本形式 while 条件: 循环体 # 判断条件是否为真,如果真,执行代码块.然后再次判断条件是否为真.如果真继续执行代码块...直到条件变成了假.循环退出 ps:死循环 ...
- Spring Boot中使用JdbcTemplate访问数据库
本文介绍在Spring Boot基础下配置数据源和通过JdbcTemplate编写数据访问的示例. 数据源配置 在我们访问数据库的时候,需要先配置一个数据源,下面分别介绍一下几种不同的数据库配置方式. ...
- tkinter如何设置界面消失 当制作一个登陆界面时,登陆成功之后,如何让登陆界面本身消失
tkinter如何设置界面消失 当制作一个登陆界面时,登陆成功之后,如何让登陆界面本身消失 if querySQL.checkAll():#用户名和密码都输入正确 self.root.withdraw ...
- ORA-01113 & ORA-01110同时出现
\NOARCHIVED LOG , 没备份 , Redo Log 被覆盖 , 某个datafile不能online 设计知识点:BBED> set block 1BBED> p kcvfh ...
- docker启动报错iptables failed: -重建docker0网络恢复
# docker启动报错 [root@localhost mysqlconf]# docker run -d -p 8080:8080 --link zookeeper:zookeeper -e du ...
- MySQL查询表结构命令
参考网址:https://www.cnblogs.com/zhangyuhang3/p/6873895.html 一.简单描述表结构,字段类型 desc tabl_name; desc tabl_na ...
- django2笔记:路由path语法
django2笔记:路由path语法 9月23,Django 发布了2.0a1版本,这是一个 feature freeze 版本,如果没有什么意外的话,2.0正式版不会再增加新的功能了.按照以往的规律 ...
- Python之Pyautogui模块20180125《PYTHON快速上手让繁琐的工作自动化》18章
复习 PyAutoGUI 的函数本章介绍了许多不同函数,下面是快速的汇总参考:moveTo(x,y)将鼠标移动到指定的 x.y 坐标.moveRel (xOffset,yOffset)相对于当前位置移 ...